import { Link } from "react-router-dom"; import type { PublicRecord } from "../../../application/ports/public-content-queries.ts"; import type { components } from "../../../contracts/studio/generated.ts"; const kindLabels = { CASE: "Case", REFERENCE: "Reference", QUESTION: "Open Question", } as const; export function PublicDocumentHeader({ record }: { record: PublicRecord }) { return (

{record.title}

{record.summary}

유형
{kindLabels[record.kind]}
프로젝트
{record.projectTitle}
게시
{record.publishedLabel}
); } export function publicRenderModelBase( record: PublicRecord, ): components["schemas"]["PublicRenderModelBase"] { return { kind: record.kind, slug: record.slug, title: record.title, summary: record.summary, publicPath: record.path, topic: { id: `topic-${record.topicSlug}`, label: record.topic, publicPath: `/topics/${record.topicSlug}`, }, project: { id: `project-${record.projectSlug}`, label: record.projectTitle, publicPath: `/projects/${record.projectSlug}`, }, relations: record.relations.map((relation, index) => ({ id: `public-relation-${index + 1}-${relation.path}`, targetId: relation.path, targetKind: relation.path.startsWith("/cases/") ? "CASE" : relation.path.startsWith("/references/") ? "REFERENCE" : relation.path.startsWith("/questions/") ? "QUESTION" : relation.path.includes("/decisions#") ? "PROJECT_DECISION" : "PROJECT", title: relation.title, publicPath: relation.path, reason: relation.reason, order: index + 1, })), renderContext: { generatedAt: record.publishedAt, dependencyRevision: "public-v1", }, }; }