// pages/rh/relatorio_atestados.tsx
import { useState } from "react";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";

export default function RelatorioAtestados() {
  const [periodo, setPeriodo] = useState("");
  const [dados, setDados] = useState<any[]>([]);

  const handleBuscar = () => {
    setDados([
      { nome: "Fernanda Alves", data: "2025-03-10", dias: 3, motivo: "Influenza" },
      { nome: "Lucas Oliveira", data: "2025-03-14", dias: 1, motivo: "Consulta médica" }
    ]);
  };

  return (
    <div className="p-6">
      <h1 className="text-xl font-bold mb-4">Relatório de Atestados</h1>
      <Card className="mb-4">
        <CardContent className="flex gap-4 pt-4">
          <Input
            type="month"
            value={periodo}
            onChange={(e) => setPeriodo(e.target.value)}
          />
          <Button onClick={handleBuscar}>Buscar</Button>
        </CardContent>
      </Card>
      <Card>
        <CardContent className="pt-4">
          <Table>
            <TableHeader>
              <TableRow>
                <TableHead>Funcionário</TableHead>
                <TableHead>Data</TableHead>
                <TableHead>Dias</TableHead>
                <TableHead>Motivo</TableHead>
              </TableRow>
            </TableHeader>
            <TableBody>
              {dados.map((item, i) => (
                <TableRow key={i}>
                  <TableCell>{item.nome}</TableCell>
                  <TableCell>{item.data}</TableCell>
                  <TableCell>{item.dias}</TableCell>
                  <TableCell>{item.motivo}</TableCell>
                </TableRow>
              ))}
            </TableBody>
          </Table>
        </CardContent>
      </Card>
    </div>
  );
}
