import { cn } from "@lib/utils" import { dmSansClassName } from "@/lib/fonts" import type { DocumentTypeEnum } from "@repo/validation/schemas" import type { z } from "zod" import { getDocumentIcon } from "@/components/new/document-modal/document-icon" type DocumentType = z.infer function getFileExtension(documentType: DocumentType): string | null { switch (documentType) { case "pdf": return ".pdf" default: return null } } export function Title({ title, documentType, url, }: { title: string | null | undefined documentType: DocumentType url?: string | null }) { const extension = getFileExtension(documentType) return (
{getDocumentIcon( documentType as DocumentType, "w-5 h-5", undefined, url ?? undefined, )} {extension && (

{extension}

)}
{title || "Untitled Document"}
) }