add-response

This commit is contained in:
João Gustavo 2025-10-10 21:19:49 -03:00
parent f934c0f33c
commit ab57567f11

View File

@ -715,8 +715,10 @@ const ProfissionalPage = () => {
</div> </div>
</div> </div>
{/* Tabela */} {/* Tabela para desktop e cards empilháveis para mobile */}
<div className="overflow-x-auto"> <div>
{/* Desktop / tablet (md+) - tabela com scroll horizontal */}
<div className="hidden md:block overflow-x-auto">
<Table> <Table>
<TableHeader> <TableHeader>
<TableRow> <TableRow>
@ -800,6 +802,58 @@ const ProfissionalPage = () => {
</TableBody> </TableBody>
</Table> </Table>
</div> </div>
{/* Mobile - cards empilháveis */}
<div className="md:hidden space-y-3">
{filteredLaudos.map((laudo) => (
<div key={laudo.id} className="bg-card p-4 rounded-lg border border-border shadow-sm">
<div className="flex justify-between items-start">
<div className="flex-1">
<div className="flex items-center justify-between">
<div>
<div className="text-sm font-medium">{getReportExam(laudo) || '-'}</div>
<div className="text-xs text-muted-foreground">{formatReportDate(getReportDate(laudo))} {laudo?.hora ? `${laudo.hora}` : ''}</div>
</div>
<div className="ml-3 text-xs font-mono text-muted-foreground">{getReportPatientName(laudo) ? getShortId(laudo.id) : ''}</div>
</div>
<div className="mt-2">
<div className="font-semibold">{getReportPatientName(laudo) || '—'}</div>
<div className="text-xs text-muted-foreground">{getReportPatientCpf(laudo) ? `CPF: ${getReportPatientCpf(laudo)}` : getReportPatientId(laudo) || '-'}</div>
</div>
</div>
<div className="flex flex-col items-end ml-4">
<div className="text-sm">{getReportExecutor(laudo) || '-'}</div>
<div className="flex gap-2 mt-3">
<Button
variant="outline"
size="sm"
onClick={() => {
setLaudoSelecionado(laudo);
setIsViewing(true);
}}
className="flex items-center gap-1"
>
<Eye className="w-4 h-4" />
</Button>
<Button
variant="default"
size="sm"
onClick={() => {
setPatientForLaudo(laudo);
setIsEditingLaudoForPatient(true);
}}
className="flex items-center gap-1 bg-green-600 hover:bg-green-700 text-white"
title="Editar laudo"
>
<Edit className="w-4 h-4" />
</Button>
</div>
</div>
</div>
</div>
))}
</div>
</div>
</div> </div>
{/* Visualizador de Laudo */} {/* Visualizador de Laudo */}
@ -842,7 +896,7 @@ const ProfissionalPage = () => {
function LaudoViewer({ laudo, onClose }: { laudo: any; onClose: () => void }) { function LaudoViewer({ laudo, onClose }: { laudo: any; onClose: () => void }) {
return ( return (
<div className="fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4"> <div className="fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4">
<div className="bg-background rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-hidden flex flex-col"> <div className="bg-background rounded-lg shadow-xl w-full h-full md:h-auto md:rounded-lg md:max-w-4xl max-h-[90vh] overflow-hidden flex flex-col">
{/* Header */} {/* Header */}
<div className="flex items-center justify-between p-4 border-b border-border"> <div className="flex items-center justify-between p-4 border-b border-border">
<div> <div>
@ -1232,7 +1286,7 @@ const ProfissionalPage = () => {
return ( return (
<div className="fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4"> <div className="fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4">
<div className="bg-background rounded-lg shadow-xl w-full max-w-6xl max-h-[90vh] overflow-hidden flex flex-col"> <div className="bg-background rounded-none md:rounded-lg shadow-xl w-full h-full md:h-auto md:max-w-6xl max-h-[90vh] overflow-hidden flex flex-col">
{/* Header */} {/* Header */}
<div className="border-b border-border"> <div className="border-b border-border">
<div className="flex items-center justify-between p-4"> <div className="flex items-center justify-between p-4">