refactor(f4): decouple findings panel from legacy act type

This commit is contained in:
2026-09-08 10:25:10 -03:00
parent d8b02bfaf1
commit f0ffde975b
@@ -4,7 +4,7 @@ import { useAuth } from '../../auth/AuthContext';
import { Alert, EmptyState, LoadingBlock, errorMessage } from '../../components/Feedback'; import { Alert, EmptyState, LoadingBlock, errorMessage } from '../../components/Feedback';
import { Icon } from '../../components/Icon'; import { Icon } from '../../components/Icon';
import { listInspectionFindings, updateInspectionFindingFollowUp } from '../../lib/api'; import { listInspectionFindings, updateInspectionFindingFollowUp } from '../../lib/api';
import type { InspectionAct, InspectionFinding } from '../../lib/api'; import type { InspectionFinding } from '../../lib/api';
import { formatDateOnly } from '../../lib/format'; import { formatDateOnly } from '../../lib/format';
import { InspectionEvidencePanel } from './InspectionEvidencePanel'; import { InspectionEvidencePanel } from './InspectionEvidencePanel';
@@ -84,7 +84,7 @@ function FindingCard({
</article>; </article>;
} }
export function InspectionFindingsPanel({ act }: { act: InspectionAct }) { export function InspectionFindingsPanel({ act }: { act: { id: string } }) {
const { hasPermission } = useAuth(); const { hasPermission } = useAuth();
const canRead = hasPermission('inspection_findings.read'); const canRead = hasPermission('inspection_findings.read');
const [findings, setFindings] = useState<InspectionFinding[]>([]); const [findings, setFindings] = useState<InspectionFinding[]>([]);