diff --git a/src/features/tech-log/presentation/public/components/public-document-header.tsx b/src/features/tech-log/presentation/public/components/public-document-header.tsx index e82fe43..1b43122 100644 --- a/src/features/tech-log/presentation/public/components/public-document-header.tsx +++ b/src/features/tech-log/presentation/public/components/public-document-header.tsx @@ -3,13 +3,7 @@ import { Link } from "react-router-dom"; import type { PublicRecord } from "../../../application/ports/public-content-queries.ts"; import type { components } from "../../../contracts/studio/generated.ts"; import { ProseText } from "../../shared/public-render/prose-text.tsx"; - -const kindLabels = { - CASE: "Case", - REFERENCE: "Reference", - QUESTION: "Open Question", - CONCEPT: "개념", -} as const; +import { DOCUMENT_KIND_LABELS } from "../../shared/document-kind-labels.ts"; export function PublicDocumentHeader({ record }: { record: PublicRecord }) { return ( @@ -18,7 +12,7 @@ export function PublicDocumentHeader({ record }: { record: PublicRecord }) { - {kindLabels[record.kind]} + {DOCUMENT_KIND_LABELS[record.kind]} {/* @@ -39,7 +33,7 @@ export function PublicDocumentHeader({ record }: { record: PublicRecord }) {
{record.summary}
diff --git a/src/features/tech-log/presentation/shared/document-kind-labels.ts b/src/features/tech-log/presentation/shared/document-kind-labels.ts new file mode 100644 index 0000000..87548a4 --- /dev/null +++ b/src/features/tech-log/presentation/shared/document-kind-labels.ts @@ -0,0 +1,21 @@ +import type { components } from "../../contracts/studio/generated.ts"; + +type RecordKind = components["schemas"]["RecordKind"]; + +/** + * 문서 종류를 사람에게 보여 주는 이름. + * + *이 표는 화면마다 하나씩 복사되어 있었고, 그래서 갈라졌다. 같은 `QUESTION` 이 공개 화면에서는 + * "Open Question", 작업본 목록과 게시 기록에서는 "Question", 편집기 상태 줄에서는 "QUESTION" 으로 + * 나왔다 — 여섯 벌 중 네 가지 표기였다. 쓰는 사람은 같은 문서를 화면마다 다른 이름으로 만난다. + * + *
한 곳에 두면 다음에 종류가 늘어날 때도 한 번만 고친다. 종류를 더하면 이 표가 비어 있는 것을
+ * 타입이 잡는다 — `Record