/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** * Document display component for IFC document references. */ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'; import { FileText } from 'lucide-react'; import type { DocumentInfo } from '@ifc-lite/parser'; export function DocumentCard({ document }: { document: DocumentInfo }) { const displayName = document.name || document.identification || 'Document'; const isUrl = document.location?.startsWith('http://') || document.location?.startsWith('https://'); return ( {displayName} {document.revision && ( {document.revision} )}
{document.identification && (
Identification {document.identification}
)} {document.name && (
Name {document.name}
)} {document.description && (
Description {document.description}
)} {document.location && (
Location {isUrl ? ( {document.location} ) : ( {document.location} )}
)} {document.purpose && (
Purpose {document.purpose}
)} {document.intendedUse && (
Intended Use {document.intendedUse}
)} {document.revision && (
Revision {document.revision}
)}
); }