mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-17 12:20:04 +00:00
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
"use client"
|
|
|
|
import type { DocumentsWithMemoriesResponseSchema } from "@repo/validation/api"
|
|
import type { z } from "zod"
|
|
import { dmSansClassName } from "@/lib/fonts"
|
|
import { cn } from "@lib/utils"
|
|
import { DocumentIcon, getDocumentTypeLabel } from "@/components/document-icon"
|
|
|
|
type DocumentsResponse = z.infer<typeof DocumentsWithMemoriesResponseSchema>
|
|
type DocumentWithMemories = DocumentsResponse["documents"][0]
|
|
|
|
export function GoogleDocsPreview({
|
|
document,
|
|
}: {
|
|
document: DocumentWithMemories
|
|
}) {
|
|
const label = getDocumentTypeLabel(document.type)
|
|
|
|
return (
|
|
<div className="bg-[#0B1017] p-3 rounded-[18px] gap-3">
|
|
<div className="flex items-center gap-2 mb-2">
|
|
<DocumentIcon
|
|
type={document.type}
|
|
url={document.url}
|
|
className="size-4"
|
|
/>
|
|
<p className={cn(dmSansClassName(), "text-[13px] font-semibold")}>
|
|
{label}
|
|
</p>
|
|
</div>
|
|
{document.summary ? (
|
|
<p className="text-[11px] text-[#737373] line-clamp-4">
|
|
{document.summary}
|
|
</p>
|
|
) : document.content ? (
|
|
<p className="text-[11px] text-[#737373] line-clamp-4">
|
|
{document.content}
|
|
</p>
|
|
) : (
|
|
<p className="text-[11px] text-[#737373] line-clamp-4">
|
|
No summary available
|
|
</p>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|