import classes from "@/features/editor/styles/editor.module.css"; import React from "react"; import { TitleEditor } from "@/features/editor/title-editor"; import PageEditor from "@/features/editor/page-editor"; import { Container, Divider, Group, Popover, Stack, Text, UnstyledButton, } from "@mantine/core"; import { useAtom } from "jotai"; import { userAtom } from "@/features/user/atoms/current-user-atom.ts"; import { CustomAvatar } from "@/components/ui/custom-avatar.tsx"; import { PageVerificationBadge } from "@/ee/page-verification"; import { useTranslation } from "react-i18next"; import { IContributor } from "@/features/page/types/page.types.ts"; const MemoizedTitleEditor = React.memo(TitleEditor); const MemoizedPageEditor = React.memo(PageEditor); type PageCreator = { id: string; name: string; avatarUrl: string; }; export interface FullEditorProps { pageId: string; slugId: string; title: string; content: string; spaceSlug: string; editable: boolean; creator?: PageCreator; contributors?: IContributor[]; canComment?: boolean; } export function FullEditor({ pageId, title, slugId, content, spaceSlug, editable, creator, contributors, canComment, }: FullEditorProps) { const [user] = useAtom(userAtom); const fullPageWidth = user.settings?.preferences?.fullPageWidth; return ( ); } type PageBylineProps = { creator?: PageCreator; contributors?: IContributor[]; readOnly?: boolean; }; function PageByline({ creator, contributors, readOnly, }: PageBylineProps) { const { t } = useTranslation(); const otherContributors = (contributors ?? []).filter( (c) => c.id !== creator?.id, ); return ( {creator && ( {t("By {{name}}", { name: creator.name })} {creator.name} {otherContributors.length === 0 ? t("Owner, no contributors") : t("Owner")} {otherContributors.length > 0 && ( <> {t("Contributors")} {otherContributors.map((contributor) => ( {contributor.name} ))} > )} )} ); }