import React, { useEffect, useState } from 'react';
import { useMoki } from '../hooks/useMoki';
import ExcelTable from '../components/ExcelTable';
import { Plus, Search } from 'lucide-react';
import {
Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DialogDescription
} from "@/components/ui/dialog";
// Reusing styled components locally
const DarkInput = ({ label, ...props }) => (
Checklists Moki
Inspeções e vistorias realizadas.
row.data?.split('T')[0] || row.data_checklist?.split('T')[0] },
{ header: 'CHECKLIST', field: 'checklist', width: '220px', className: 'font-bold text-emerald-600 dark:text-emerald-500' },
{ header: 'STATUS CHECKLIST', field: 'status_checklist', width: '150px' },
{ header: 'STATUS', field: 'status', width: '120px', render: (row) => (
{row.status || 'Pendente'}
)},
{ header: 'UNIDADE', field: 'unidade', width: '150px' },
{ header: 'COD. UNIDADE', field: 'cod_unidade', width: '120px' },
{ header: 'NOME UNIDADE', field: 'nome_unidade', width: '180px' },
{ header: 'STATUS UNIDADE', field: 'status_unidade', width: '120px' },
{ header: 'AUTOR', field: 'autor', width: '120px' },
{ header: 'ORIGEM', field: 'origem', width: '120px' },
{ header: 'APROVAÇÃO', field: 'aprovacao', width: '120px' },
]}
filterDefs={[
{ field: 'origem', label: 'Origem', type: 'select' },
{ field: 'unidade', label: 'Unidade', type: 'select' },
{ field: 'checklist', label: 'Checklist', type: 'select' },
{ field: 'status', label: 'Status', type: 'select' },
{ field: 'autor', label: 'Autor', type: 'select' },
]}
onEdit={handleOpenModal}
onDelete={(item) => deleteMoki(item.idmoki_frota)}
/>
);
}