// pages/rh/relatorio_admissoes.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 RelatorioAdmissoes() {
  const [periodo, setPeriodo] = useState("");
  const [dados, setDados] = useState<any[]>([]);

  const handleBuscar = () => {
    // Simulação
    setDados([
      { nome: "Carlos Henrique", data: "2024-12-01", cargo: "Motorista" },
      { nome: "Ana Silva", data: "2025-01-10", cargo: "Administrativo" }
    ]);
  };

  return (
    <div className="p-6">
      <h1 className="text-xl font-bold mb-4">Relatório de Admissões</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>Nome</TableHead>
                <TableHead>Cargo</TableHead>
                <TableHead>Data de Admissão</TableHead>
              </TableRow>
            </TableHeader>
            <TableBody>
              {dados.map((item, i) => (
                <TableRow key={i}>
                  <TableCell>{item.nome}</TableCell>
                  <TableCell>{item.cargo}</TableCell>
                  <TableCell>{item.data}</TableCell>
                </TableRow>
              ))}
            </TableBody>
          </Table>
        </CardContent>
      </Card>
    </div>
  );
}
