diff --git a/src/app/(protected)/(cadastros)/cadastros/(t_tb_reconhecimentotipo)/reconhecimentos/page.tsx b/src/app/(protected)/(cadastros)/cadastros/(t_tb_reconhecimentotipo)/reconhecimentos/page.tsx index ac533b6..4bab9e4 100644 --- a/src/app/(protected)/(cadastros)/cadastros/(t_tb_reconhecimentotipo)/reconhecimentos/page.tsx +++ b/src/app/(protected)/(cadastros)/cadastros/(t_tb_reconhecimentotipo)/reconhecimentos/page.tsx @@ -134,156 +134,6 @@ export default function TTBReconhecimentoTipoPage() { - - - - - - - # - - - Situação - - - Descrição - - - - - - - {reconhecimentosTipos.map( - (item: ITTTBReconhecimentoTipo) => ( - - - {item.tb_reconhecimentotipo_id} - - - {item.situacao === 'A' ? ( - - Ativo - - ) : ( - - Inativo - - )} - - - {item.descricao} - - - - - - - - - - - openForm(item)}> - Editar - - - handlingConfirmation(true, item)}> - Remover - - - - - - - ) - )} - - - - - - - {/* Formulário dentro do Dialog */} - - - - - - - Tipos de Reconhecimentos - - Tipos de reconhecimentos são usados na tela de balcão - - - ( - - Descrição - - - - - - )} - /> - - ( - field.onChange(checked ? "A" : "I")} - /> - )} - /> - - Ativo - - - - - - Cancelar - - - - Salvar - - - - - - - - - - - - - - - #{item?.tb_reconhecimentotipo_id} - {item?.descricao} - - - Esta ação não pode ser desfeita. Isso excluirá permanentemente o registro e seus dados dos nossos servidores. - - - - handlingConfirmation(false, null)} className="cursor-pointer"> - Cancelar - - - Continuar - - - - - ) } diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoAlert.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoAlert.tsx new file mode 100644 index 0000000..a95e312 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoAlert.tsx @@ -0,0 +1,28 @@ +import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog"; + +export default function TTBReconhecimentoTipoAlert() { + + return ( + + + + + #{item?.tb_reconhecimentotipo_id} - {item?.descricao} + + + Esta ação não pode ser desfeita. Isso excluirá permanentemente o registro e seus dados dos nossos servidores. + + + + handlingConfirmation(false, null)} className="cursor-pointer"> + Cancelar + + + Continuar + + + + + ); + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoForm.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoForm.tsx new file mode 100644 index 0000000..ffa8e5e --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoForm.tsx @@ -0,0 +1,74 @@ +import { Button } from "@/components/ui/button"; +import { Checkbox } from "@/components/ui/checkbox"; +import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; +import { FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"; +import { Label } from "@/components/ui/label"; +import { Controller, Form } from "react-hook-form"; + +export default function TTBReconhecimentoTipoForm() { + + return ( + + {/* Formulário dentro do Dialog */} + + + + + + + Tipos de Reconhecimentos + + Tipos de reconhecimentos são usados na tela de balcão + + + ( + + Descrição + + + + + + )} + /> + + ( + field.onChange(checked ? "A" : "I")} + /> + )} + /> + + Ativo + + + + + + Cancelar + + + + Salvar + + + + + + + + + + ); + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoTable.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoTable.tsx new file mode 100644 index 0000000..72ce875 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoTable.tsx @@ -0,0 +1,85 @@ +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; +import { EllipsisIcon, PencilIcon, Trash2 } from "lucide-react"; +import TTBReconhecimentoTipoInterface from "../../_interfaces/TTBReconhecimentoTipoInterface"; + +interface Props { + data: TTBReconhecimentoTipoInterface, + onEdit: (item: TTBReconhecimentoTipoInterface) => void, + onDelete: (item: TTBReconhecimentoTipoInterface) => void, +} + +export default function TTBReconhecimentoTipoTable() { + + return ( + + + + + + + # + + + Situação + + + Descrição + + + + + + + {reconhecimentosTipos.map( + (item: ITTTBReconhecimentoTipo) => ( + + + {item.tb_reconhecimentotipo_id} + + + {item.situacao === 'A' ? ( + + Ativo + + ) : ( + + Inativo + + )} + + + {item.descricao} + + + + + + + + + + + openForm(item)}> + Editar + + + handlingConfirmation(true, item)}> + Remover + + + + + + + ) + )} + + + + + ); + +} \ No newline at end of file