import type { SBOMData } from '../types'

interface SbomMetadataProps {
  sbomData: SBOMData
}

export function SbomMetadata({ sbomData }: SbomMetadataProps) {
  if (!sbomData.metadata) return null

  return (
    <div className="bg-slate-50 rounded-lg p-4 mb-6 text-sm">
      <div className="flex flex-wrap gap-6">
        <div>
          <span className="text-slate-500">Format:</span>
          <span className="ml-2 font-medium">{sbomData.bomFormat} {sbomData.specVersion}</span>
        </div>
        <div>
          <span className="text-slate-500">Generiert:</span>
          <span className="ml-2 font-medium">
            {sbomData.metadata.timestamp ? new Date(sbomData.metadata.timestamp).toLocaleString('de-DE') : '-'}
          </span>
        </div>
        <div>
          <span className="text-slate-500">Anwendung:</span>
          <span className="ml-2 font-medium">
            {sbomData.metadata.component?.name} v{sbomData.metadata.component?.version}
          </span>
        </div>
      </div>
    </div>
  )
}
