import { Head, Link, useForm } from '@inertiajs/react';
import { Download, FileLock2, Pencil, Upload } from 'lucide-react';
import { useRef } from 'react';
import {
FormErrors,
PageTitle,
Panel,
controlClass,
} from '@/components/procurement';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { date } from '@/types/procurement';
import {
documentTypes,
supplierFields,
supplierStatuses,
} from '@/types/supplier';
import type { Supplier } from '@/types/supplier';
type Document = {
id: number;
original_name: string;
document_type: string;
size: number;
created_at: string;
sha256: string;
};
type Props = {
supplier: Supplier;
documents: Document[];
canEdit: boolean;
canDocuments: boolean;
canReview: boolean;
};
export default function SupplierShow({
supplier,
documents,
canEdit,
canDocuments,
canReview,
}: Props) {
const upload = useForm<{ file: File | null; document_type: string }>({
file: null,
document_type: 'license',
});
const review = useForm({ status: 'active', comment: '' });
const fileInput = useRef
Última validação: {supplier.review_comment}
)}{document.original_name}
{ documentTypes[ document.document_type ] }{' '} ·{' '} {Math.ceil( document.size / 1024, )}{' '} KB · {date(document.created_at)}
Ainda não existem documentos anexados a esta ficha.
)}O acesso aos documentos está reservado a Administração, Procurement e Finanças.
)} {canReview && (