- )
+ );
}
-function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
- return (
-
- )
+function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
+ return
;
}
-function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
+function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
return (
- )
+ );
}
-function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
+function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
return (
tr]:last:border-b-0",
- className
- )}
+ className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}
{...props}
/>
- )
+ );
}
-function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
+function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
return (
- )
+ );
}
-function TableHead({ className, ...props }: React.ComponentProps<"th">) {
+function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
return (
[role=checkbox]]:translate-y-[2px]",
- className
+ 'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
+ className,
)}
{...props}
/>
- )
+ );
}
-function TableCell({ className, ...props }: React.ComponentProps<"td">) {
+function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
return (
| [role=checkbox]]:translate-y-[2px]",
- className
+ 'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
+ className,
)}
{...props}
/>
- )
+ );
}
-function TableCaption({
- className,
- ...props
-}: React.ComponentProps<"caption">) {
+function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
return (
- )
+ );
}
-export {
- Table,
- TableHeader,
- TableBody,
- TableFooter,
- TableHead,
- TableRow,
- TableCell,
- TableCaption,
-}
+export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
diff --git a/src/packages/administrativo/components/CCaixaServico/CCaixaServicoSelect.tsx b/src/packages/administrativo/components/CCaixaServico/CCaixaServicoSelect.tsx
index 125a8aa..3b03b5e 100644
--- a/src/packages/administrativo/components/CCaixaServico/CCaixaServicoSelect.tsx
+++ b/src/packages/administrativo/components/CCaixaServico/CCaixaServicoSelect.tsx
@@ -1,97 +1,96 @@
'use client';
-import React from "react";
-import { Button } from "@/components/ui/button";
+import React from 'react';
+import { Button } from '@/components/ui/button';
import {
- Command,
- CommandEmpty,
- CommandGroup,
- CommandInput,
- CommandItem,
- CommandList,
-} from "@/components/ui/command";
-import { FormControl } from "@/components/ui/form";
-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
-import { cn } from "@/lib/utils";
-import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
-import GetCapitalize from "@/shared/actions/text/GetCapitalize";
-import { useCCaixaServicoReadHook } from "@/app/(protected)/(cadastros)/cadastros/_hooks/c_caixa_servico/useCCaixaServicoReadHook";
-import { CCaixaServicoReadInterface } from "@/app/(protected)/(cadastros)/cadastros/_interfaces/CCaixaServicoReadInterface";
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from '@/components/ui/command';
+import { FormControl } from '@/components/ui/form';
+import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
+import { cn } from '@/lib/utils';
+import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
+import GetCapitalize from '@/shared/actions/text/GetCapitalize';
+import { useCCaixaServicoReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/c_caixa_servico/useCCaixaServicoReadHook';
+import { CCaixaServicoReadInterface } from '@/app/(protected)/(cadastros)/cadastros/_interfaces/CCaixaServicoReadInterface';
export default function CCaixaServicoSelect({ sistema_id, field }: any) {
+ const cCaixaServicoReadParams: CCaixaServicoReadInterface = { sistema_id };
- const cCaixaServicoReadParams: CCaixaServicoReadInterface = { sistema_id };
-
- const [open, setOpen] = React.useState(false);
- const [isLoading, setIsLoading] = React.useState(false);
- const { cCaixaServico, fetchCCaixaServico } = useCCaixaServicoReadHook();
- // Busca os dados uma única vez ao montar
- React.useEffect(() => {
- const loadData = async () => {
- if (!cCaixaServico.length) {
- setIsLoading(true);
- await fetchCCaixaServico(cCaixaServicoReadParams);
- setIsLoading(false);
- }
- };
- loadData();
- }, []);
- const selected = cCaixaServico?.find(
- (item) => String(item.caixa_servico_id) === String(field.value)
- );
- return (
-
-
-
-
-
-
-
-
-
-
-
- {isLoading ? "Carregando..." : "Nenhum resultado encontrado."}
-
-
- {cCaixaServico?.map((item) => (
- {
- field.onChange(Number(item.caixa_servico_id)); // envia apenas o número
- setOpen(false);
- }}
- >
-
- {GetCapitalize(item.descricao)}
-
- ))}
-
-
-
-
-
- );
+ const [open, setOpen] = React.useState(false);
+ const [isLoading, setIsLoading] = React.useState(false);
+ const { cCaixaServico, fetchCCaixaServico } = useCCaixaServicoReadHook();
+ // Busca os dados uma única vez ao montar
+ React.useEffect(() => {
+ const loadData = async () => {
+ if (!cCaixaServico.length) {
+ setIsLoading(true);
+ await fetchCCaixaServico(cCaixaServicoReadParams);
+ setIsLoading(false);
+ }
+ };
+ loadData();
+ }, []);
+ const selected = cCaixaServico?.find(
+ (item) => String(item.caixa_servico_id) === String(field.value),
+ );
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ {isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
+
+
+ {cCaixaServico?.map((item) => (
+ {
+ field.onChange(Number(item.caixa_servico_id)); // envia apenas o número
+ setOpen(false);
+ }}
+ >
+
+ {GetCapitalize(item.descricao)}
+
+ ))}
+
+
+
+
+
+ );
}
diff --git a/src/packages/administrativo/components/GCidade/GCidadeForm.tsx b/src/packages/administrativo/components/GCidade/GCidadeForm.tsx
index b455abc..c386a5e 100644
--- a/src/packages/administrativo/components/GCidade/GCidadeForm.tsx
+++ b/src/packages/administrativo/components/GCidade/GCidadeForm.tsx
@@ -35,7 +35,6 @@ import { useGUfReadHook } from '@/packages/administrativo/hooks/GUF/useGUfReadHo
import { GCidadeSchema } from '../../schemas/GCidade/GCidadeSchema';
-
// Hook responsável em trazer todos os estados brasileiros
// Define o tipo do formulário com base no schema Zod
diff --git a/src/packages/administrativo/components/GEmolumento/GEmolumentoSelect.tsx b/src/packages/administrativo/components/GEmolumento/GEmolumentoSelect.tsx
index 0b3df97..e073935 100644
--- a/src/packages/administrativo/components/GEmolumento/GEmolumentoSelect.tsx
+++ b/src/packages/administrativo/components/GEmolumento/GEmolumentoSelect.tsx
@@ -1,158 +1,156 @@
'use client'; // Garante execução no cliente (Next.js App Router)
-import React from "react";
-import { Button } from "@/components/ui/button";
+import React from 'react';
+import { Button } from '@/components/ui/button';
import {
- Command,
- CommandEmpty,
- CommandGroup,
- CommandInput,
- CommandItem,
- CommandList,
-} from "@/components/ui/command";
-import { FormControl } from "@/components/ui/form";
-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
-import { cn } from "@/lib/utils";
-import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
-import GetCapitalize from "@/shared/actions/text/GetCapitalize";
-import { useGEmolumentoReadHook } from "@/app/(protected)/(cadastros)/cadastros/_hooks/g_emolumento/useGEmolumentoReadHook";
-import { GEmolumentoReadInterface } from "@/app/(protected)/(cadastros)/cadastros/_interfaces/GEmolumentoReadInterface";
-
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from '@/components/ui/command';
+import { FormControl } from '@/components/ui/form';
+import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
+import { cn } from '@/lib/utils';
+import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
+import GetCapitalize from '@/shared/actions/text/GetCapitalize';
+import { useGEmolumentoReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/g_emolumento/useGEmolumentoReadHook';
+import { GEmolumentoReadInterface } from '@/app/(protected)/(cadastros)/cadastros/_interfaces/GEmolumentoReadInterface';
// Tipagem das props do componente
interface GEmolumentoSelectProps {
- sistema_id: number; // ID do sistema usado para buscar os emolumentos
- field: any; // Objeto de controle do react-hook-form
- onSelectChange?: (emolumento: { key: number; value: string }) => void; // Função callback opcional para disparar eventos externos
- className?: string; // Classe CSS opcional para customização
+ sistema_id: number; // ID do sistema usado para buscar os emolumentos
+ field: any; // Objeto de controle do react-hook-form
+ onSelectChange?: (emolumento: { key: number; value: string }) => void; // Função callback opcional para disparar eventos externos
+ className?: string; // Classe CSS opcional para customização
}
-
// Componente principal do select de emolumentos
-export default function GEmolumentoSelect({ sistema_id, field, onSelectChange, className }: GEmolumentoSelectProps) {
+export default function GEmolumentoSelect({
+ sistema_id,
+ field,
+ onSelectChange,
+ className,
+}: GEmolumentoSelectProps) {
+ // Define parâmetros de leitura para o hook que busca os emolumentos
+ const gEmolumentoReadParams: GEmolumentoReadInterface = { sistema_id };
- // Define parâmetros de leitura para o hook que busca os emolumentos
- const gEmolumentoReadParams: GEmolumentoReadInterface = { sistema_id };
+ // Estados locais do componente
+ const [open, setOpen] = React.useState(false); // Controla abertura do popover
+ const [isLoading, setIsLoading] = React.useState(false); // Exibe “Carregando...” enquanto busca dados
- // Estados locais do componente
- const [open, setOpen] = React.useState(false); // Controla abertura do popover
- const [isLoading, setIsLoading] = React.useState(false); // Exibe “Carregando...” enquanto busca dados
+ // Hook responsável por buscar emolumentos no backend
+ const { gEmolumento, fetchGEmolumento } = useGEmolumentoReadHook();
- // Hook responsável por buscar emolumentos no backend
- const { gEmolumento, fetchGEmolumento } = useGEmolumentoReadHook();
+ // Carrega os dados de emolumentos apenas uma vez ao montar o componente
+ React.useEffect(() => {
+ const loadData = async () => {
+ if (!gEmolumento.length) {
+ setIsLoading(true);
+ await fetchGEmolumento(gEmolumentoReadParams);
+ setIsLoading(false);
+ }
+ };
+ loadData();
+ }, []); // ← executa apenas uma vez
- // Carrega os dados de emolumentos apenas uma vez ao montar o componente
- React.useEffect(() => {
- const loadData = async () => {
- if (!gEmolumento.length) {
- setIsLoading(true);
- await fetchGEmolumento(gEmolumentoReadParams);
- setIsLoading(false);
- }
- };
- loadData();
- }, []); // ← executa apenas uma vez
+ // Obtém o item selecionado com base no valor atual do campo
+ const selected = gEmolumento?.find(
+ (item) => Number(item.emolumento_id) === Number(field.value ?? 0),
+ );
+ // Estrutura visual do componente
+ return (
+
+ {/* === Botão principal (exibe valor selecionado) === */}
+
+
+
+
+
+ {/* === Conteúdo do Popover (lista de opções) === */}
+
+
+ {/* Campo de busca dentro do popover */}
+
- // Estrutura visual do componente
- return (
-
- {/* === Botão principal (exibe valor selecionado) === */}
-
-
-
-
-
+
+ {/* Estado vazio ou carregando */}
+
+ {isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
+
- {/* === Conteúdo do Popover (lista de opções) === */}
-
-
- {/* Campo de busca dentro do popover */}
-
+ {/* Grupo de opções */}
+
+ {gEmolumento?.map((item) => (
+ {
+ // Cria objeto com ID e descrição
+ const selectedValue = {
+ key: Number(item.emolumento_id),
+ value: item.descricao,
+ };
-
- {/* Estado vazio ou carregando */}
-
- {isLoading ? "Carregando..." : "Nenhum resultado encontrado."}
-
+ // Atualiza o valor no react-hook-form com o ID numérico
+ field.onChange(Number(item.emolumento_id ?? 0));
- {/* Grupo de opções */}
-
- {gEmolumento?.map((item) => (
- {
- // Cria objeto com ID e descrição
- const selectedValue = {
- key: Number(item.emolumento_id),
- value: item.descricao,
- };
+ // Dispara callback externo, se existir (mantém o objeto completo)
+ if (onSelectChange)
+ onSelectChange({
+ key: Number(item.emolumento_id),
+ value: item.descricao,
+ });
- // Atualiza o valor no react-hook-form com o ID numérico
- field.onChange(Number(item.emolumento_id ?? 0));
-
- // Dispara callback externo, se existir (mantém o objeto completo)
- if (onSelectChange)
- onSelectChange({
- key: Number(item.emolumento_id),
- value: item.descricao,
- });
-
- // Fecha o popover
- setOpen(false);
- }}
-
- >
- {/* Ícone de seleção (check) */}
-
- {/* Nome formatado do emolumento */}
- {GetCapitalize(item.descricao)}
-
- ))}
-
-
-
-
-
- );
+ // Fecha o popover
+ setOpen(false);
+ }}
+ >
+ {/* Ícone de seleção (check) */}
+
+ {/* Nome formatado do emolumento */}
+ {GetCapitalize(item.descricao)}
+
+ ))}
+
+
+
+
+
+ );
}
diff --git a/src/packages/administrativo/components/GMarcacaoTipo/GMarcacaoTipoSelect.tsx b/src/packages/administrativo/components/GMarcacaoTipo/GMarcacaoTipoSelect.tsx
index e6c6058..4720476 100644
--- a/src/packages/administrativo/components/GMarcacaoTipo/GMarcacaoTipoSelect.tsx
+++ b/src/packages/administrativo/components/GMarcacaoTipo/GMarcacaoTipoSelect.tsx
@@ -1,102 +1,101 @@
'use client';
-import React from "react";
-import { Button } from "@/components/ui/button";
+import React from 'react';
+import { Button } from '@/components/ui/button';
import {
- Command,
- CommandEmpty,
- CommandGroup,
- CommandInput,
- CommandItem,
- CommandList,
-} from "@/components/ui/command";
-import { FormControl } from "@/components/ui/form";
-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
-import { cn } from "@/lib/utils";
-import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
-import GetCapitalize from "@/shared/actions/text/GetCapitalize";
-import { useGMarcacaoTipoReadHook } from "@/app/(protected)/(cadastros)/cadastros/_hooks/g_marcacao_tipo/useGMarcacaoTipoReadHook";
-import { GMarcacaoTipoReadInterface } from "@/app/(protected)/(cadastros)/cadastros/_interfaces/GMarcacaoTipoReadInterface";
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from '@/components/ui/command';
+import { FormControl } from '@/components/ui/form';
+import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
+import { cn } from '@/lib/utils';
+import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
+import GetCapitalize from '@/shared/actions/text/GetCapitalize';
+import { useGMarcacaoTipoReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/g_marcacao_tipo/useGMarcacaoTipoReadHook';
+import { GMarcacaoTipoReadInterface } from '@/app/(protected)/(cadastros)/cadastros/_interfaces/GMarcacaoTipoReadInterface';
export default function GMarcacaoTipoSelect({ grupo, sistema_id, situacao, field }: any) {
+ const gMarcacaoTipoReadParams: GMarcacaoTipoReadInterface = { grupo, sistema_id, situacao };
- const gMarcacaoTipoReadParams: GMarcacaoTipoReadInterface = { grupo, sistema_id, situacao };
-
- const [open, setOpen] = React.useState(false);
- const [isLoading, setIsLoading] = React.useState(false);
- const { gMarcacaoTipo, fetchGMarcacaoTipo } = useGMarcacaoTipoReadHook();
- // Busca os dados uma única vez ao montar
- React.useEffect(() => {
- const loadData = async () => {
- if (!gMarcacaoTipo.length) {
- setIsLoading(true);
- await fetchGMarcacaoTipo(gMarcacaoTipoReadParams);
- setIsLoading(false);
- }
- };
- loadData();
- }, []);
- const selected = gMarcacaoTipo?.find(
- (item) => String(item.marcacao_tipo_id) === String(field.value)
- );
- return (
-
-
-
-
-
-
-
-
-
-
-
- {isLoading ? "Carregando..." : "Nenhum resultado encontrado."}
-
-
- {gMarcacaoTipo?.map((item) => (
- {
- field.onChange({
- key: Number(item.marcacao_tipo_id),
- value: item.descricao,
- });
- setOpen(false);
- }}
- >
-
- {GetCapitalize(item.descricao)}
-
- ))}
-
-
-
-
-
- );
+ const [open, setOpen] = React.useState(false);
+ const [isLoading, setIsLoading] = React.useState(false);
+ const { gMarcacaoTipo, fetchGMarcacaoTipo } = useGMarcacaoTipoReadHook();
+ // Busca os dados uma única vez ao montar
+ React.useEffect(() => {
+ const loadData = async () => {
+ if (!gMarcacaoTipo.length) {
+ setIsLoading(true);
+ await fetchGMarcacaoTipo(gMarcacaoTipoReadParams);
+ setIsLoading(false);
+ }
+ };
+ loadData();
+ }, []);
+ const selected = gMarcacaoTipo?.find(
+ (item) => String(item.marcacao_tipo_id) === String(field.value),
+ );
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ {isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
+
+
+ {gMarcacaoTipo?.map((item) => (
+ {
+ field.onChange({
+ key: Number(item.marcacao_tipo_id),
+ value: item.descricao,
+ });
+ setOpen(false);
+ }}
+ >
+
+ {GetCapitalize(item.descricao)}
+
+ ))}
+
+
+
+
+
+ );
}
diff --git a/src/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex.tsx b/src/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex.tsx
index 9d04acf..ac1fce7 100644
--- a/src/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex.tsx
+++ b/src/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex.tsx
@@ -17,7 +17,6 @@ import { useGMedidaTipoRemoveHook } from '../../hooks/GMedidaTipo/useGMedidaTipo
import { useGMedidaTipoSaveHook } from '../../hooks/GMedidaTipo/useGMedidaTipoSaveHook';
import { GMedidaTipoInterface } from '../../interfaces/GMedidaTipo/GMedidaTipoInterface';
-
const initialMedidaTipo: GMedidaTipoInterface = {
medida_tipo_id: 0,
sigla: '',
diff --git a/src/packages/administrativo/components/GNatureza/GNaturezaIndex.tsx b/src/packages/administrativo/components/GNatureza/GNaturezaIndex.tsx
index 55940a9..195da05 100644
--- a/src/packages/administrativo/components/GNatureza/GNaturezaIndex.tsx
+++ b/src/packages/administrativo/components/GNatureza/GNaturezaIndex.tsx
@@ -2,7 +2,6 @@
import { useEffect, useState, useCallback } from 'react';
-
import { useGNaturezaDeleteHook } from '@/packages/administrativo/hooks/GNatureza/useGNaturezaDeleteHook';
import { useGNaturezaIndexHook } from '@/packages/administrativo/hooks/GNatureza/useGNaturezaIndexHook';
import { useGNaturezaSaveHook } from '@/packages/administrativo/hooks/GNatureza/useGNaturezaSaveHook';
diff --git a/src/packages/administrativo/components/GTBBairro/GTBBairroIndex.tsx b/src/packages/administrativo/components/GTBBairro/GTBBairroIndex.tsx
index 5a6528a..5fb9e13 100644
--- a/src/packages/administrativo/components/GTBBairro/GTBBairroIndex.tsx
+++ b/src/packages/administrativo/components/GTBBairro/GTBBairroIndex.tsx
@@ -17,7 +17,6 @@ import GTBBairroForm from './GTBBairroForm';
import GTBBairroTable from './GTBBairroTable';
import { GTBBairroInterface } from '../../interfaces/GTBBairro/GTBBairroInterface';
-
const initialBairro: GTBBairroInterface = {
sistema_id: null,
tb_bairro_id: 0,
diff --git a/src/packages/administrativo/components/GTBBairro/GTBBairroTable.tsx b/src/packages/administrativo/components/GTBBairro/GTBBairroTable.tsx
index c4f3454..bc215ed 100644
--- a/src/packages/administrativo/components/GTBBairro/GTBBairroTable.tsx
+++ b/src/packages/administrativo/components/GTBBairro/GTBBairroTable.tsx
@@ -23,7 +23,6 @@ import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
import { GTBBairroInterface } from '../../interfaces/GTBBairro/GTBBairroInterface';
-
interface GTBBairroTableProps {
data: GTBBairroInterface[];
onEdit: (item: GTBBairroInterface, isEditingFormStatus: boolean) => void;
diff --git a/src/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex.tsx b/src/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex.tsx
index 2ea7bc3..92d092a 100644
--- a/src/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex.tsx
+++ b/src/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex.tsx
@@ -16,7 +16,6 @@ import { useGTBEstadoCivilRemoveHook } from '../../hooks/GTBEstadoCivil/useGTBEs
import { useGTBEstadoCivilSaveHook } from '../../hooks/GTBEstadoCivil/useGTBEstadoCivilSaveHook';
import { GTBEstadoCivilInterface } from '../../interfaces/GTBEstadoCivil/GTBEstadoCivilInterface';
-
const initalEstadoCivil: GTBEstadoCivilInterface = {
tb_estadocivil_id: 0,
sistema_id: 0,
diff --git a/src/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensForm.tsx b/src/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensForm.tsx
index 5808300..eed693a 100644
--- a/src/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensForm.tsx
+++ b/src/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensForm.tsx
@@ -28,7 +28,6 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { GTBRegimeBensSchema } from '@/packages/administrativo/schemas/GTBRegimeBens/GTBRegimeBensSchema';
-
type FormValues = z.infer;
interface Props {
diff --git a/src/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex.tsx b/src/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex.tsx
index 547cdc1..b33e312 100644
--- a/src/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex.tsx
+++ b/src/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex.tsx
@@ -15,7 +15,6 @@ import { useGTBRegimeComunhaoRemoveHook } from '../../hooks/GTBRegimeComunhao/us
import { useGTBRegimeComunhaoSaveHook } from '../../hooks/GTBRegimeComunhao/useGTBRegimeComunhaoSaveHook';
import GTBRegimeComunhaoInterface from '../../interfaces/GTBRegimeComunhao/GTBRegimeComunhaoInterface';
-
export default function GTBRegimeComunhaoIndex() {
// Hooks para leitura e salvamento
const { gTBRegimeComunhao, fetchGTBRegimeComunhao } = useGTBRegimeComunhaoReadHook();
diff --git a/src/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex.tsx b/src/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex.tsx
index 72f790d..228ed26 100644
--- a/src/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex.tsx
+++ b/src/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex.tsx
@@ -16,7 +16,6 @@ import { useGTBTipoLogradouroRemoveHook } from '../../hooks/GTBTipoLogradouro/us
import { useGTBTipoLogradouroSaveHook } from '../../hooks/GTBTipoLogradouro/useGTBTipoLogradouroSaveHook';
import { GTBTipoLogradouroInterface } from '../../interfaces/GTBTipoLogradouro/GTBTipoLogradouroInterface';
-
export default function GTBTipoLogradouroIndex() {
// Controle de exibição de respostas
const { setResponse } = useResponse();
diff --git a/src/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex.tsx b/src/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex.tsx
index 5ef0c11..aeb6ebe 100644
--- a/src/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex.tsx
+++ b/src/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex.tsx
@@ -2,7 +2,6 @@
import { useEffect, useState, useCallback } from 'react';
-
import { useTAtoParteTipoDeleteHook } from '@/packages/administrativo/hooks/TAtoParteTipo/useTAtoParteTipoDeleteHook';
import { useTAtoParteTipoIndexHook } from '@/packages/administrativo/hooks/TAtoParteTipo/useTAtoParteTipoIndexHook';
import { useTAtoParteTipoSaveHook } from '@/packages/administrativo/hooks/TAtoParteTipo/useTAtoParteTipoSaveHook';
diff --git a/src/packages/administrativo/components/TCensec/TCensecIndex.tsx b/src/packages/administrativo/components/TCensec/TCensecIndex.tsx
index 3074935..2e4a0d6 100644
--- a/src/packages/administrativo/components/TCensec/TCensecIndex.tsx
+++ b/src/packages/administrativo/components/TCensec/TCensecIndex.tsx
@@ -15,7 +15,6 @@ import { useTCensecReadHook } from '../../hooks/TCensec/useTCensecReadHook';
import { useTCensecSaveHook } from '../../hooks/TCensec/useTCensecSaveHook';
import TCensecInterface from '../../interfaces/TCensec/TCensecInterface';
-
export default function TCensecIndex() {
// Controle de estado do botão
const [buttonIsLoading, setButtonIsLoading] = useState(false);
diff --git a/src/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex.tsx b/src/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex.tsx
index 2b251a2..6c46a87 100644
--- a/src/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex.tsx
+++ b/src/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex.tsx
@@ -17,7 +17,6 @@ import TCensecNaturezaLitigioForm from './TCensecNaturezaLitigioForm';
import TCensecNaturezaLitigioTable from './TCensecNaturezaLitigioTable';
import { TCensecNaturezaLitigioInterface } from '../../interfaces/TCensecNaturezaLitigio/TCensecNaturezaLitigioInterface';
-
const initialCensecNaturezaLitigio: TCensecNaturezaLitigioInterface = {
censec_naturezalitigio_id: 0,
descricao: '',
diff --git a/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeForm.tsx b/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeForm.tsx
index 2c07e31..3d17091 100644
--- a/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeForm.tsx
+++ b/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeForm.tsx
@@ -29,7 +29,6 @@ import SituacoesSelect from '@/shared/components/situacoes/SituacoesSelect';
import { useTCensecQualidadeFormHook } from '../../hooks/TCensecQualidade/useTCensecQualidadeHook';
import { TCensecQualidadeFormInterface } from '../../interfaces/TCensecQualidade/TCensecQualidadeFormInterface';
-
export default function TCensecQualidadeForm({
isOpen,
data,
diff --git a/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex.tsx b/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex.tsx
index 85f6b4d..bdeb86e 100644
--- a/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex.tsx
+++ b/src/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex.tsx
@@ -2,7 +2,6 @@
import { useEffect, useState, useCallback } from 'react';
-
import { useTCensecQualidadeDeleteHook } from '@/packages/administrativo/hooks/TCensecQualidade/useTCensecQualidadeDeleteHook';
import { useTCensecQualidadeIndexHook } from '@/packages/administrativo/hooks/TCensecQualidade/useTCensecQualidadeIndexHook';
import { useTCensecQualidadeSaveHook } from '@/packages/administrativo/hooks/TCensecQualidade/useTCensecQualidadeSaveHook';
diff --git a/src/packages/administrativo/components/TCensecQualidadeAto/TCensecQualidadeAtoIndex.tsx b/src/packages/administrativo/components/TCensecQualidadeAto/TCensecQualidadeAtoIndex.tsx
index 0ffafbd..3e46dbe 100644
--- a/src/packages/administrativo/components/TCensecQualidadeAto/TCensecQualidadeAtoIndex.tsx
+++ b/src/packages/administrativo/components/TCensecQualidadeAto/TCensecQualidadeAtoIndex.tsx
@@ -2,7 +2,6 @@
import React, { useEffect, useState, useCallback } from 'react';
-
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
import Header from '@/shared/components/structure/Header';
diff --git a/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoForm.tsx b/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoForm.tsx
index 1e6761f..8158703 100644
--- a/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoForm.tsx
+++ b/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoForm.tsx
@@ -41,7 +41,6 @@ import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
import TCensecInterface from '../../interfaces/TCensec/TCensecInterface';
import { TCensecTipoAtoSchema } from '../../schemas/TCensecTipoAto/TCensecTipoAtoSchema';
-
type FormValues = z.infer;
interface TCensecTipoAtoFormProps {
diff --git a/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex.tsx b/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex.tsx
index 70a3f57..9fdaa6a 100644
--- a/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex.tsx
+++ b/src/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex.tsx
@@ -17,7 +17,6 @@ import { useTCensecTipoAtoRemoveHook } from '../../hooks/TCensecTipoAto/useTCens
import { useTCensecTipoAtoSaveHook } from '../../hooks/TCensecTipoAto/useTCensecTipoAtoSaveHook';
import { TCensecTipoAtoInterface } from '../../interfaces/TCensecTipoAto/TCensecTipoAtoInterface';
-
// Estado inicial para criação
const initialTCensecTipoAto: TCensecTipoAtoInterface = {
censec_tipoato_id: 0,
diff --git a/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaForm.tsx b/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaForm.tsx
index f3950fe..91b5514 100644
--- a/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaForm.tsx
+++ b/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaForm.tsx
@@ -32,7 +32,6 @@ import { useTCensecTipoNaturezaFormHook } from '../../hooks/TCensecTipoNatureza/
import { TCensecTipoNaturezaFormInterface } from '../../interfaces/TCensecTipoNatureza/TCensecTipoNaturezaFormInterface';
import TCensecTipoAtoSelect from '../TCensecTipoAto/TCensecTipoAtoSelect';
-
export default function TCensecTipoNaturezaForm({
isOpen,
data,
diff --git a/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex.tsx b/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex.tsx
index 53ff874..795d8a2 100644
--- a/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex.tsx
+++ b/src/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex.tsx
@@ -2,7 +2,6 @@
import { useEffect, useState, useCallback } from 'react';
-
import { useTCensecTipoNaturezaDeleteHook } from '@/packages/administrativo/hooks/TCensecTipoNatureza/useTCensecTipoNaturezaDeleteHook';
import { useTCensecTipoNaturezaIndexHook } from '@/packages/administrativo/hooks/TCensecTipoNatureza/useTCensecTipoNaturezaIndexHook';
import { useTCensecTipoNaturezaSaveHook } from '@/packages/administrativo/hooks/TCensecTipoNatureza/useTCensecTipoNaturezaSaveHook';
diff --git a/src/packages/administrativo/components/TImovel/TImovelForm.tsx b/src/packages/administrativo/components/TImovel/TImovelForm.tsx
index 4e45508..66e9d61 100644
--- a/src/packages/administrativo/components/TImovel/TImovelForm.tsx
+++ b/src/packages/administrativo/components/TImovel/TImovelForm.tsx
@@ -34,8 +34,6 @@ import GTBBairroSelect from '../GTBBairro/GTBBairroSelect';
import TImovelUnidadeRuralIndex from '../TImovelUnidade/TImovelUnidadeRural/TImovelUnidadeRuralIndex';
import TImovelUnidadeUrbanoPage from '../TImovelUnidade/TImovelUnidadeUrbano/TImovelUnidadeUrbanoIndex';
-
-
export default function TImovelForm({
isOpen,
data,
diff --git a/src/packages/administrativo/components/TImovel/TImovelIndex.tsx b/src/packages/administrativo/components/TImovel/TImovelIndex.tsx
index bf6b260..73ccb35 100644
--- a/src/packages/administrativo/components/TImovel/TImovelIndex.tsx
+++ b/src/packages/administrativo/components/TImovel/TImovelIndex.tsx
@@ -2,7 +2,6 @@
import { useEffect, useState, useCallback } from 'react';
-
import { useTImovelDeleteHook } from '@/packages/administrativo/hooks/TImovel/useTImovelDeleteHook';
import { useTImovelIndexHook } from '@/packages/administrativo/hooks/TImovel/useTImovelIndexHook';
import { useTImovelSaveHook } from '@/packages/administrativo/hooks/TImovel/useTImovelSaveHook';
diff --git a/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeRural/TImovelUnidadeRuralIndex.tsx b/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeRural/TImovelUnidadeRuralIndex.tsx
index 386ede0..3eeaeeb 100644
--- a/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeRural/TImovelUnidadeRuralIndex.tsx
+++ b/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeRural/TImovelUnidadeRuralIndex.tsx
@@ -2,7 +2,6 @@
import { useEffect, useState, useCallback } from 'react';
-
import { useTImovelUnidadeRuralDeleteHook } from '@/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralDeleteHook';
import { useTImovelUnidadeRuralIndexHook } from '@/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralIndexHook';
import { useTImovelUnidadeRuralSaveHook } from '@/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralSaveHook';
diff --git a/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeUrbano/TImovelUnidadeUrbanoIndex.tsx b/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeUrbano/TImovelUnidadeUrbanoIndex.tsx
index 3513ba1..9257ead 100644
--- a/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeUrbano/TImovelUnidadeUrbanoIndex.tsx
+++ b/src/packages/administrativo/components/TImovelUnidade/TImovelUnidadeUrbano/TImovelUnidadeUrbanoIndex.tsx
@@ -14,7 +14,6 @@ import Header from '@/shared/components/structure/Header';
import TImovelUnidadeUrbanoForm from './TImovelUnidadeUrbanoForm';
import TImovelUnidadeUrbanoTable from './TImovelUnidadeUrbanoTable';
-
export default function TImovelUnidadeUrbanoPage({ imovel_id }: TImovelUnidadePageInterface) {
const TImovelUnidadePage: TImovelUnidadePageInterface = {
imovel_id: imovel_id,
diff --git a/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaColumns.tsx b/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaColumns.tsx
index c67bee5..d8a5d6d 100644
--- a/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaColumns.tsx
+++ b/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaColumns.tsx
@@ -17,7 +17,6 @@ import { FormatPhone } from '@/shared/actions/phone/FormatPhone';
import GetNameInitials from '@/shared/actions/text/GetNameInitials';
import empty from '@/shared/actions/validations/empty';
-
/**
* Função para criar a definição das colunas da tabela
*/
diff --git a/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaForm.tsx b/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaForm.tsx
index 10bfff3..50c5aab 100644
--- a/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaForm.tsx
+++ b/src/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaForm.tsx
@@ -42,7 +42,6 @@ import { Sexo } from '@/shared/enums/SexoEnum';
import { useGTBEstadoCivilReadHook } from '../../../hooks/GTBEstadoCivil/useGTBEstadoCivilReadHook';
-
import { useGTBRegimeComunhaoReadHook } from '../../../hooks/GTBRegimeComunhao/useGTBRegimeComunhaoReadHook';
import { useTPessoaFisicaFormHook } from '@/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaFormHook';
diff --git a/src/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaColumns.tsx b/src/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaColumns.tsx
index fe9e0a8..f999158 100644
--- a/src/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaColumns.tsx
+++ b/src/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaColumns.tsx
@@ -16,7 +16,6 @@ import { FormatDateTime } from '@/shared/actions/dateTime/FormatDateTime';
import { FormatPhone } from '@/shared/actions/phone/FormatPhone';
import empty from '@/shared/actions/validations/empty';
-
export default function TPessoaJuridicaColumns(
onEdit: (item: TPessoaJuridicaInterface, isEditingFormStatus: boolean) => void,
onDelete: (item: TPessoaJuridicaInterface, isEditingFormStatus: boolean) => void,
diff --git a/src/packages/administrativo/components/TPessoaRepresentante/TPessoaRepresentanteIndex.tsx b/src/packages/administrativo/components/TPessoaRepresentante/TPessoaRepresentanteIndex.tsx
index 5669279..4dfed26 100644
--- a/src/packages/administrativo/components/TPessoaRepresentante/TPessoaRepresentanteIndex.tsx
+++ b/src/packages/administrativo/components/TPessoaRepresentante/TPessoaRepresentanteIndex.tsx
@@ -2,8 +2,6 @@
import React, { useEffect, useState, useCallback } from 'react';
-
-
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
import Loading from '@/shared/components/loading/loading';
diff --git a/src/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex.tsx b/src/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex.tsx
index 098b71d..a28f781 100644
--- a/src/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex.tsx
+++ b/src/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex.tsx
@@ -15,7 +15,6 @@ import TTBAndamentoServicoForm from './TTBAndamentoServicoForm';
import TTBAndamentoServicoTable from './TTBAndamentoServicoTable';
import TTBAndamentoServicoInterface from '../../interfaces/TTBAndamentoServico/TTBAndamentoServicoInterface';
-
export default function TTBAndamentoServicoIndex() {
// Hooks para leitura e salvamento
const { tTBAndamentosServicos, fetchTTBAndamentoServico } = useTTBAndamentoServicoReadHook();
diff --git a/src/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoSelect.tsx b/src/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoSelect.tsx
index cb77454..1a00275 100644
--- a/src/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoSelect.tsx
+++ b/src/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoSelect.tsx
@@ -1,95 +1,94 @@
'use client';
-import React from "react";
-import { Button } from "@/components/ui/button";
+import React from 'react';
+import { Button } from '@/components/ui/button';
import {
- Command,
- CommandEmpty,
- CommandGroup,
- CommandInput,
- CommandItem,
- CommandList,
-} from "@/components/ui/command";
-import { FormControl } from "@/components/ui/form";
-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
-import { cn } from "@/lib/utils";
-import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
-import GetCapitalize from "@/shared/actions/text/GetCapitalize";
-import { useTTBReconhecimentoTipoReadHook } from "@/app/(protected)/(cadastros)/cadastros/_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoReadHook";
-import { TTBREconhecimentoTipoReadInterface } from "@/app/(protected)/(cadastros)/cadastros/_interfaces/TTBREconhecimentoTipoReadInterface";
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from '@/components/ui/command';
+import { FormControl } from '@/components/ui/form';
+import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
+import { cn } from '@/lib/utils';
+import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
+import GetCapitalize from '@/shared/actions/text/GetCapitalize';
+import { useTTBReconhecimentoTipoReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoReadHook';
+import { TTBREconhecimentoTipoReadInterface } from '@/app/(protected)/(cadastros)/cadastros/_interfaces/TTBREconhecimentoTipoReadInterface';
export default function TTBReconhecimentoTipoSelect({ field }: any) {
-
- const [open, setOpen] = React.useState(false);
- const [isLoading, setIsLoading] = React.useState(false);
- const { tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo } = useTTBReconhecimentoTipoReadHook();
- // Busca os dados uma única vez ao montar
- React.useEffect(() => {
- const loadData = async () => {
- if (!tTBReconhecimentoTipo.length) {
- setIsLoading(true);
- await fetchTTBReconhecimentoTipo();
- setIsLoading(false);
- }
- };
- loadData();
- }, []);
- const selected = tTBReconhecimentoTipo?.find(
- (item) => Number(item.tb_reconhecimentotipo_id) === Number(field.value)
- );
- return (
-
-
-
-
-
-
-
-
-
-
-
- {isLoading ? "Carregando..." : "Nenhum resultado encontrado."}
-
-
- {tTBReconhecimentoTipo?.map((item) => (
- {
- field.onChange(Number(item.tb_reconhecimentotipo_id)); // envia apenas o número
- setOpen(false);
- }}
- >
-
- {GetCapitalize(item.descricao)}
-
- ))}
-
-
-
-
-
- );
+ const [open, setOpen] = React.useState(false);
+ const [isLoading, setIsLoading] = React.useState(false);
+ const { tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo } = useTTBReconhecimentoTipoReadHook();
+ // Busca os dados uma única vez ao montar
+ React.useEffect(() => {
+ const loadData = async () => {
+ if (!tTBReconhecimentoTipo.length) {
+ setIsLoading(true);
+ await fetchTTBReconhecimentoTipo();
+ setIsLoading(false);
+ }
+ };
+ loadData();
+ }, []);
+ const selected = tTBReconhecimentoTipo?.find(
+ (item) => Number(item.tb_reconhecimentotipo_id) === Number(field.value),
+ );
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ {isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
+
+
+ {tTBReconhecimentoTipo?.map((item) => (
+ {
+ field.onChange(Number(item.tb_reconhecimentotipo_id)); // envia apenas o número
+ setOpen(false);
+ }}
+ >
+
+ {GetCapitalize(item.descricao)}
+
+ ))}
+
+
+
+
+
+ );
}
diff --git a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralDeleteHook.ts b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralDeleteHook.ts
index d37c636..c548209 100644
--- a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralDeleteHook.ts
+++ b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralDeleteHook.ts
@@ -4,7 +4,6 @@ import { TImovelUnidadeRuralInterface } from '@/packages/administrativo/interfac
import { TImovelUnidadeRuralDeleteService } from '@/packages/administrativo/services/TImovelUnidade/TImovelUnidadeRural/TImovelUnidadeRuralDeleteService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTImovelUnidadeRuralDeleteHook = () => {
const { setResponse } = useResponse();
diff --git a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralSaveHook.ts b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralSaveHook.ts
index f0cdc8e..a41410f 100644
--- a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralSaveHook.ts
+++ b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeRural/useTImovelUnidadeRuralSaveHook.ts
@@ -6,7 +6,6 @@ import { TImovelUnidadeRuralInterface } from '@/packages/administrativo/interfac
import { TImovelUnidadeRuralSaveService } from '@/packages/administrativo/services/TImovelUnidade/TImovelUnidadeRural/TImovelUnidadeRuralSaveService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTImovelUnidadeRuralSaveHook = () => {
const { setResponse } = useResponse();
diff --git a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoDeleteHook.ts b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoDeleteHook.ts
index 5a3fd63..fc40c13 100644
--- a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoDeleteHook.ts
+++ b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoDeleteHook.ts
@@ -4,7 +4,6 @@ import { TImovelUnidadeUrbanoInterface } from '@/packages/administrativo/interfa
import { TImovelUnidadeUrbanoDeleteService } from '@/packages/administrativo/services/TImovelUnidade/TImovelUnidadeUrbano/TImovelUnidadeUrbanoDeleteService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTImovelUnidadeUrbanoDeleteHook = () => {
const { setResponse } = useResponse();
diff --git a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoSaveHook.ts b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoSaveHook.ts
index 6d95c79..a4ae9a7 100644
--- a/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoSaveHook.ts
+++ b/src/packages/administrativo/hooks/TImovelUnidade/TImovelUnidadeUrbano/useTImovelUnidadeUrbanoSaveHook.ts
@@ -6,7 +6,6 @@ import { TImovelUnidadeUrbanoInterface } from '@/packages/administrativo/interfa
import { TImovelUnidadeUrbanoSaveService } from '@/packages/administrativo/services/TImovelUnidade/TImovelUnidadeUrbano/TImovelUnidadeUrbanoSaveService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTImovelUnidadeUrbanoSaveHook = () => {
const { setResponse } = useResponse();
diff --git a/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaIndexHook.ts b/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaIndexHook.ts
index 4b6e609..feb748a 100644
--- a/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaIndexHook.ts
+++ b/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaIndexHook.ts
@@ -4,7 +4,6 @@ import TPessoaFisicaInterface from '@/packages/administrativo/interfaces/TPessoa
import { TPessoaFisicaIndexService } from '@/packages/administrativo/services/TPessoa/TPessoaFisica/TPessoaFisicaIndexService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTPessoaFisicaIndexHook = () => {
const { setResponse } = useResponse();
diff --git a/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaSaveHook.ts b/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaSaveHook.ts
index 3ca7682..8c93098 100644
--- a/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaSaveHook.ts
+++ b/src/packages/administrativo/hooks/TPessoa/TPessoaFisica/useTPessoaFisicaSaveHook.ts
@@ -6,7 +6,6 @@ import TPessoaFisicaInterface from '@/packages/administrativo/interfaces/TPessoa
import { TPessoaFisicaSaveService } from '@/packages/administrativo/services/TPessoa/TPessoaFisica/TPessoaFisicaSaveService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTPessoaFisicaSaveHook = () => {
const { setResponse } = useResponse();
diff --git a/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaIndexHook.ts b/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaIndexHook.ts
index e612185..90b4b07 100644
--- a/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaIndexHook.ts
+++ b/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaIndexHook.ts
@@ -4,7 +4,6 @@ import TPessoaJuridicaInterface from '@/packages/administrativo/interfaces/TPess
import { TPessoaJuridicaIndexService } from '@/packages/administrativo/services/TPessoa/TPessoaJuridica/TPessoaJuridicaIndexService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTPessoaJuridicaIndexHook = () => {
const { setResponse } = useResponse();
const [tPessoaJuridica, setPessoaJuridica] = useState([]);
diff --git a/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaSaveHook.ts b/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaSaveHook.ts
index 0c90c86..9048c24 100644
--- a/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaSaveHook.ts
+++ b/src/packages/administrativo/hooks/TPessoa/TPessoaJuridica/useTPessoaJuridicaSaveHook.ts
@@ -6,7 +6,6 @@ import TPessoaJuridicaInterface from '@/packages/administrativo/interfaces/TPess
import { TPessoaJuridicaSaveService } from '@/packages/administrativo/services/TPessoa/TPessoaJuridica/TPessoaJuridicaSaveService';
import { useResponse } from '@/shared/components/response/ResponseContext';
-
export const useTPessoaJuridicaSaveHook = () => {
const { setResponse } = useResponse();
diff --git a/src/shared/actions/api/buildQueryString.ts b/src/shared/actions/api/buildQueryString.ts
index 37293fe..7f05445 100644
--- a/src/shared/actions/api/buildQueryString.ts
+++ b/src/shared/actions/api/buildQueryString.ts
@@ -11,4 +11,4 @@ export function buildQueryString(params: Record): string {
.join('&');
return query ? `?${query}` : '';
-}
\ No newline at end of file
+}
diff --git a/src/shared/components/categoriaServicoSelect/CategoriaServicoSelect.tsx b/src/shared/components/categoriaServicoSelect/CategoriaServicoSelect.tsx
index 47c3a0d..701e953 100644
--- a/src/shared/components/categoriaServicoSelect/CategoriaServicoSelect.tsx
+++ b/src/shared/components/categoriaServicoSelect/CategoriaServicoSelect.tsx
@@ -1,87 +1,85 @@
-import { Button } from "@/components/ui/button";
+import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
+import React from 'react';
+
+import { Button } from '@/components/ui/button';
import {
- Command,
- CommandEmpty,
- CommandGroup,
- CommandInput,
- CommandItem,
- CommandList,
-} from "@/components/ui/command";
-import { FormControl } from "@/components/ui/form";
-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
-import { cn } from "@/lib/utils";
-import { CategoriaServicoEnum } from "@/shared/enums/CategoriaServicoEnum";
-import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
-import React from "react";
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from '@/components/ui/command';
+import { FormControl } from '@/components/ui/form';
+import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
+import { cn } from '@/lib/utils';
+import { CategoriaServicoEnum } from '@/shared/enums/CategoriaServicoEnum';
type CategoriaServicoSelectProps = {
- field: {
- value?: string | null;
- onChange: (value: string) => void;
- };
+ field: {
+ value?: string | null;
+ onChange: (value: string) => void;
+ };
};
export default function CategoriaServicoSelect({ field }: CategoriaServicoSelectProps) {
- const [open, setOpen] = React.useState(false);
+ const [open, setOpen] = React.useState(false);
- // Cria as opções a partir do enum
- const options = Object.entries(CategoriaServicoEnum).map(([key, label]) => ({
- value: String(key),
- label,
- }));
+ // Cria as opções a partir do enum
+ const options = Object.entries(CategoriaServicoEnum).map(([key, label]) => ({
+ value: String(key),
+ label,
+ }));
- const selectedLabel =
- field.value != null
- ? options.find((o) => o.value === String(field.value))?.label ?? "Selecione..."
- : "Selecione...";
+ const selectedLabel =
+ field.value != null
+ ? (options.find((o) => o.value === String(field.value))?.label ?? 'Selecione...')
+ : 'Selecione...';
- return (
-
-
-
-
-
-
-
-
-
-
- Nenhum resultado encontrado.
-
- {options.map((item) => (
- {
- field.onChange(item.value); // envia número
- setOpen(false);
- }}
- >
-
- {item.label}
-
- ))}
-
-
-
-
-
- );
+ return (
+
+
+
+
+
+
+
+
+
+
+ Nenhum resultado encontrado.
+
+ {options.map((item) => (
+ {
+ field.onChange(item.value); // envia número
+ setOpen(false);
+ }}
+ >
+
+ {item.label}
+
+ ))}
+
+
+
+
+
+ );
}
diff --git a/src/shared/components/confirmacao/ConfirmacaoCheckBox.tsx b/src/shared/components/confirmacao/ConfirmacaoCheckBox.tsx
index 2b8255f..706bab2 100644
--- a/src/shared/components/confirmacao/ConfirmacaoCheckBox.tsx
+++ b/src/shared/components/confirmacao/ConfirmacaoCheckBox.tsx
@@ -1,5 +1,5 @@
-import { FormControl, FormField, FormItem, FormLabel } from "@/components/ui/form";
-import { Checkbox } from "@/components/ui/checkbox";
+import { Checkbox } from '@/components/ui/checkbox';
+import { FormControl, FormField, FormItem, FormLabel } from '@/components/ui/form';
interface ConfirmacaoCheckBoxProps {
name: string;
@@ -13,14 +13,14 @@ export function ConfirmacaoCheckBox({ name, label, control }: ConfirmacaoCheckBo
control={control}
name={name}
render={({ field }) => (
-
+
field.onChange(checked ? "S" : "N")}
+ checked={field.value === 'S'}
+ onCheckedChange={(checked) => field.onChange(checked ? 'S' : 'N')}
/>
- {label}
+ {label}
)}
/>
diff --git a/src/shared/components/confirmacao/ConfirmacaoSelect.tsx b/src/shared/components/confirmacao/ConfirmacaoSelect.tsx
index 363f07a..686affd 100644
--- a/src/shared/components/confirmacao/ConfirmacaoSelect.tsx
+++ b/src/shared/components/confirmacao/ConfirmacaoSelect.tsx
@@ -31,16 +31,16 @@ export default function ConfirmacaoSelect({ field }: any) {
variant="outline"
role="combobox"
aria-expanded={open}
- className="justify-between cursor-pointer"
+ className="cursor-pointer justify-between"
>
{field.value
? options.find((item) => item.value === field.value)?.label
: 'Selecione...'}
-
+
-
+
diff --git a/src/shared/components/dataTable/DataTable.tsx b/src/shared/components/dataTable/DataTable.tsx
index 44e8baa..f99c703 100644
--- a/src/shared/components/dataTable/DataTable.tsx
+++ b/src/shared/components/dataTable/DataTable.tsx
@@ -33,7 +33,6 @@ import {
TableRow,
} from '@/components/ui/table';
-
import DataTableInterface from './interfaces/DataTableInterface';
export function DataTable({
diff --git a/src/shared/components/numericInputField/NumericInputField.tsx b/src/shared/components/numericInputField/NumericInputField.tsx
index b136ee4..5df99e0 100644
--- a/src/shared/components/numericInputField/NumericInputField.tsx
+++ b/src/shared/components/numericInputField/NumericInputField.tsx
@@ -1,15 +1,10 @@
-"use client";
+'use client';
-import React from "react";
-import { Control, FieldValues, Path } from "react-hook-form";
-import {
- FormField,
- FormItem,
- FormLabel,
- FormControl,
- FormMessage,
-} from "@/components/ui/form";
-import { Input } from "@/components/ui/input";
+import React from 'react';
+import { Control, FieldValues, Path } from 'react-hook-form';
+
+import { FormField, FormItem, FormLabel, FormControl, FormMessage } from '@/components/ui/form';
+import { Input } from '@/components/ui/input';
interface NumericInputFieldProps {
control: Control;
@@ -24,8 +19,8 @@ interface NumericInputFieldProps {
export function NumericInputField({
control,
name,
- label = "Número",
- placeholder = "Digite um número",
+ label = 'Número',
+ placeholder = 'Digite um número',
disabled = false,
min,
max,
@@ -43,13 +38,13 @@ export function NumericInputField({
{...field}
type="text"
disabled={disabled}
- value={field.value ?? ""}
+ value={field.value ?? ''}
placeholder={placeholder}
inputMode="numeric"
pattern="[0-9]*"
onChange={(e) => {
// Mantém apenas números
- let value = e.target.value.replace(/[^0-9]/g, "");
+ let value = e.target.value.replace(/[^0-9]/g, '');
// Limita faixa, se definido
if (min !== undefined && Number(value) < min) value = String(min);
diff --git a/src/shared/components/tipoPessoa/tipoPessoaSelect.tsx b/src/shared/components/tipoPessoa/tipoPessoaSelect.tsx
index dabe9fd..abbd70b 100644
--- a/src/shared/components/tipoPessoa/tipoPessoaSelect.tsx
+++ b/src/shared/components/tipoPessoa/tipoPessoaSelect.tsx
@@ -1,21 +1,16 @@
-"use client";
+'use client';
-import React from "react";
-import { Control, FieldValues, Path } from "react-hook-form";
-import {
- FormField,
- FormItem,
- FormLabel,
- FormControl,
- FormMessage,
-} from "@/components/ui/form";
+import React from 'react';
+import { Control, FieldValues, Path } from 'react-hook-form';
+
+import { FormField, FormItem, FormLabel, FormControl, FormMessage } from '@/components/ui/form';
import {
Select,
SelectTrigger,
SelectValue,
SelectContent,
SelectItem,
-} from "@/components/ui/select";
+} from '@/components/ui/select';
interface PessoaTipoSelectProps {
control: Control;
@@ -28,9 +23,9 @@ interface PessoaTipoSelectProps {
export function TipoPessoaSelect({
control,
name,
- label = "Pessoa",
+ label = 'Pessoa',
disabled = false,
- placeholder = "Selecione uma opção",
+ placeholder = 'Selecione uma opção',
}: PessoaTipoSelectProps) {
return (
({
render={({ field }) => (
{label && {label}}
- |