Compare commits
127 commits
release(DS
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b664221d5d | ||
|
|
c3511a7065 | ||
|
|
5ef46780a5 | ||
|
|
fd79837fdc | ||
|
|
b5ea5a75a8 | ||
|
|
4561194b6b | ||
|
|
c8863e573f | ||
|
|
fca1d0c293 | ||
|
|
32937c9501 | ||
|
|
790dbe2df3 | ||
|
|
4770c42596 | ||
|
|
aceb17b235 | ||
|
|
21d5d94197 | ||
|
|
8f9659ea5b | ||
|
|
e39970587b | ||
|
|
bcbcc8557b | ||
|
|
f6f4892d09 | ||
|
|
1e9627e924 | ||
|
|
f23decf071 | ||
|
|
43d0863342 | ||
|
|
e24a35709b | ||
|
|
3eb0bd6f0e | ||
|
|
c6217b0520 | ||
|
|
7a2305c918 | ||
|
|
26f0016813 | ||
|
|
0ec57bd6f8 | ||
|
|
50814c9b14 | ||
|
|
2f891ffc38 | ||
|
|
52d16a1548 | ||
|
|
26df474611 | ||
|
|
cdc5e953a5 | ||
|
|
f1abddb383 | ||
|
|
824ac5da24 | ||
|
|
386b8b0307 | ||
|
|
a400bd233e | ||
|
|
60dce3876a | ||
|
|
7745961ff6 | ||
|
|
69d34c713e | ||
|
|
91346bfb19 | ||
|
|
d2494f20b7 | ||
|
|
4ef0517cb7 | ||
|
|
714a0e1f97 | ||
|
|
df46a60b81 | ||
|
|
0dc065d9bb | ||
|
|
99791bd06f | ||
|
|
5f8d2cf670 | ||
|
|
369dfcdfc3 | ||
|
|
f4b0118b36 | ||
|
|
053b86ee69 | ||
|
|
f7b13648a1 | ||
|
|
744e51d215 | ||
|
|
41f31ed2f1 | ||
|
|
0e3cb35309 | ||
|
|
24e259fc16 | ||
|
|
6fc76254c0 | ||
|
|
1c4d52ebe9 | ||
|
|
6e4646c96b | ||
|
|
f09b152192 | ||
|
|
ff3ff6c2e0 | ||
|
|
f9df3cd8a3 | ||
|
|
e98a293286 | ||
|
|
4c16b19184 | ||
|
|
de3a022800 | ||
|
|
4da16c3fe2 | ||
|
|
d1732558ff | ||
|
|
58630f8602 | ||
|
|
6b6f2e4fc8 | ||
|
|
2d37d4d421 | ||
|
|
fdd4cf7cfc | ||
|
|
bc2c2ef3dd | ||
|
|
b2e0d50dd6 | ||
|
|
97c958cb00 | ||
|
|
6fe6c86b5d | ||
|
|
b85cd6aeb9 | ||
|
|
88cb6f67c8 | ||
|
|
790c79ede6 | ||
|
|
06d55ec125 | ||
| e50818e52a | |||
| 79f2092882 | |||
| 8d44686717 | |||
| 7162a20d1f | |||
| b362968a4f | |||
| 23604033fe | |||
| 4b7afd6a8f | |||
| feab092f6e | |||
| e39422776e | |||
| 8e035546e9 | |||
| 6051afc3e0 | |||
| 9b9f8b9454 | |||
| 2340cee82a | |||
| 0e21ebfe5b | |||
| 3faf0ebe5e | |||
| b9318f1059 | |||
| 64b897e7e9 | |||
| 77ea800aaa | |||
| 2810abecf5 | |||
| 325ca69317 | |||
| d5b8aad221 | |||
| d3d8ac4a28 | |||
| 8d5e786f74 | |||
| 5297d6ab2e | |||
| 56bca3ba41 | |||
| ab45ac32bf | |||
| 36cbd43ee4 | |||
| b48ffc4bd5 | |||
| 3bd3134d33 | |||
| aaaa04975e | |||
| 519dbf969a | |||
| 4559de0187 | |||
| 6c7967587a | |||
| 742c9bc38f | |||
| a26fc881b2 | |||
| d3f8bebe1d | |||
| 11578438bf | |||
| cbaf19af0b | |||
| ff28fe1f58 | |||
| 9e37520615 | |||
| 79370f83f1 | |||
| cb3f1ffcba | |||
| 37f0f8713d | |||
| 0d5ee71975 | |||
| 27d0b7e2de | |||
| 3b38337358 | |||
| 36dba45995 | |||
| aa8553b3fe | |||
|
|
3df00e38bc | ||
|
|
7fe725bdeb |
993 changed files with 31343 additions and 19567 deletions
117
.code-workspace
Normal file
117
.code-workspace
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"folders": [{ "path": "D:/IIS/Orius/app" }],
|
||||
"settings": {
|
||||
// === GERAL ===
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.organizeImports": "explicit",
|
||||
},
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnType": false,
|
||||
"editor.minimap.enabled": false,
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.autoSave": "onFocusChange",
|
||||
"telemetry.telemetryLevel": "off",
|
||||
"update.mode": "manual",
|
||||
|
||||
// === PERFORMANCE ===
|
||||
"files.watcherExclude": {
|
||||
"**/node_modules/**": true,
|
||||
"**/dist/**": true,
|
||||
"**/build/**": true,
|
||||
"**/.next/**": true,
|
||||
"**/.git/**": true,
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/dist": true,
|
||||
"**/.next": true,
|
||||
"**/.git": true,
|
||||
},
|
||||
|
||||
// === FRONTEND ===
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
},
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
},
|
||||
|
||||
// === TAILWIND ===
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss",
|
||||
},
|
||||
"tailwindCSS.includeLanguages": {
|
||||
"plaintext": "html",
|
||||
"javascript": "javascript",
|
||||
"typescriptreact": "typescriptreact",
|
||||
},
|
||||
|
||||
// === TERMINAIS ===
|
||||
"terminal.integrated.profiles.windows": {
|
||||
"Next.js Dev": {
|
||||
"path": "cmd.exe",
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run dev"],
|
||||
},
|
||||
"Build & Preview": {
|
||||
"path": "cmd.exe",
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run build && npm run start"],
|
||||
},
|
||||
"Git Bash": {
|
||||
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
|
||||
},
|
||||
},
|
||||
"terminal.integrated.defaultProfile.windows": "Git Bash",
|
||||
|
||||
// === GIT ===
|
||||
"git.enabled": true,
|
||||
"git.autorefresh": false,
|
||||
"git.fetchOnPull": true,
|
||||
"git.confirmSync": false,
|
||||
|
||||
// === VISUAL ===
|
||||
"workbench.colorTheme": "Default Dark Modern",
|
||||
"window.zoomLevel": 0,
|
||||
"breadcrumbs.enabled": true,
|
||||
"explorer.compactFolders": false,
|
||||
|
||||
// === MISC ===
|
||||
"files.exclude": {
|
||||
"**/.DS_Store": true,
|
||||
"**/*.log": true,
|
||||
},
|
||||
},
|
||||
"launch": {
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Next.js: Debug Development Server",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run", "dev"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"port": 9229,
|
||||
},
|
||||
],
|
||||
},
|
||||
"extensions": {
|
||||
"recommendations": [
|
||||
// === FRONTEND CORE ===
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"ms-vscode.vscode-typescript-next",
|
||||
|
||||
// === DEV EXPERIENCE ===
|
||||
"formulahendry.code-runner",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"eamodio.gitlens",
|
||||
"mhutchie.git-graph",
|
||||
"donjayamanne.githistory",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
// .eslintrc.json
|
||||
{
|
||||
"extends": [
|
||||
// 1. Configurações base do Next/React
|
||||
"next/core-web-vitals",
|
||||
// 2. Regras para ordenar e gerenciar importações
|
||||
"plugin:import/recommended",
|
||||
// 3. DESATIVA as regras do ESLint que conflitam com o Prettier (DEVE SER O ÚLTIMO)
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["import"],
|
||||
"rules": {
|
||||
/* --- Qualidade do Código (Next.js/React) --- */
|
||||
// Essa regra (já incluída no Next.js, mas bom reforçar) é a que remove imports não usados
|
||||
"no-unused-vars": "error",
|
||||
"react/jsx-uses-vars": "error",
|
||||
/* --- Ordem e Remoção de Importações (eslint-plugin-import) --- */
|
||||
// Configura a regra para a ordem das importações (groups/grupos)
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
|
||||
"newlines-between": "always",
|
||||
"alphabetize": {
|
||||
"order": "asc",
|
||||
"caseInsensitive": true
|
||||
}
|
||||
}
|
||||
],
|
||||
// Garante que o Next.js reconheça imports (como 'next/image', 'next/link')
|
||||
"import/no-unresolved": "error"
|
||||
}
|
||||
}
|
||||
65
Dockerfile
65
Dockerfile
|
|
@ -1,22 +1,59 @@
|
|||
# Use uma imagem Node.js completa para o desenvolvimento
|
||||
FROM node:20-alpine
|
||||
# ============================
|
||||
# STAGE 1 – Build
|
||||
# ============================
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
# Define o diretório de trabalho no container
|
||||
WORKDIR /app
|
||||
|
||||
# Copia os arquivos de configuração do projeto
|
||||
COPY package.json package-lock.json ./
|
||||
# Copia pacotes e instala dependências
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Instala todas as dependências do projeto
|
||||
# Isso é necessário para o modo de desenvolvimento, pois o build não pré-compila os arquivos.
|
||||
RUN npm install
|
||||
|
||||
# Copia o restante do código da sua aplicação
|
||||
# Copia o restante do código
|
||||
COPY . .
|
||||
|
||||
# Expõe a porta de desenvolvimento padrão do Next.js
|
||||
# ---------- Variáveis de build ----------
|
||||
# Estas variáveis são usadas pelo Next.js durante o "build"
|
||||
# para embutir no bundle do frontend.
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_STATE
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_URL
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_PREFIX
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
|
||||
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_STATE=$NEXT_PUBLIC_ORIUS_APP_STATE
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_URL=$NEXT_PUBLIC_ORIUS_APP_API_URL
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_PREFIX=$NEXT_PUBLIC_ORIUS_APP_API_PREFIX
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=$NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
|
||||
|
||||
# ---------- Build ----------
|
||||
ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
|
||||
# ============================
|
||||
# STAGE 2 – Runner (standalone)
|
||||
# ============================
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# ---------- Variáveis em runtime ----------
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Copia apenas o necessário do build
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package*.json ./
|
||||
|
||||
# ---------- Corrige permissões ----------
|
||||
RUN addgroup -S nodejs && adduser -S nextjs -G nodejs \
|
||||
&& mkdir -p .next/cache/images \
|
||||
&& chown -R nextjs:nodejs /app
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# Define o comando para iniciar a aplicação em modo de desenvolvimento
|
||||
# Isso ativará o servidor de desenvolvimento e a recarga automática
|
||||
CMD ["npm", "run", "dev"]
|
||||
# ---------- Executa o servidor ----------
|
||||
CMD ["node", "server.js"]
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
# Etapa 1: Construir a aplicação
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
# Define o diretório de trabalho
|
||||
WORKDIR /app
|
||||
|
||||
# Copia os arquivos de configuração do pacote
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Instala as dependências do projeto
|
||||
RUN npm install
|
||||
|
||||
# Copia todo o código da aplicação para o container
|
||||
COPY . .
|
||||
|
||||
# Constrói a aplicação com o output 'standalone'
|
||||
RUN npm run build
|
||||
|
||||
# Etapa 2: Executar a aplicação
|
||||
# Usa uma imagem Node.js leve
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
# Define o diretório de trabalho
|
||||
WORKDIR /app
|
||||
|
||||
# Copia o diretório 'standalone' da etapa de build, que já contém o servidor e as dependências
|
||||
# O diretório 'standalone' é a pasta .next/standalone gerada pela configuração 'output: standalone'
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
|
||||
# Copia os arquivos públicos
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
# Copia os arquivos estáticos gerados pelo build. É aqui que os arquivos CSS e JS ficam.
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
# Expõe a porta padrão do Next.js
|
||||
EXPOSE 3000
|
||||
|
||||
# Define o comando para iniciar a aplicação
|
||||
# O 'start' do package.json não é necessário, o próprio servidor standalone já está no container
|
||||
CMD ["node", "server.js"]
|
||||
57
README.md
57
README.md
|
|
@ -1 +1,58 @@
|
|||
# saas_app
|
||||
|
||||
Criar envlocal para usar variaveis de ambiente no em desenvolvimento
|
||||
NEXT_PUBLIC_ORIUS_APP_STATE=GO
|
||||
NEXT_PUBLIC_ORIUS_APP_API_URL=<http://localhost:8000/>
|
||||
NEXT_PUBLIC_ORIUS_APP_API_PREFIX=api/v1/
|
||||
NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=application/json
|
||||
|
||||
## Modo Debug
|
||||
|
||||
Abra Run → Add Configuration… → Attach to Node.js
|
||||
|
||||
Configure:
|
||||
|
||||
{
|
||||
"name": "Attach Next.js (9230)",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 9230,
|
||||
"restart": true,
|
||||
"smartStep": true,
|
||||
"skipFiles": ["<node_internals>/**"]
|
||||
}
|
||||
|
||||
npm run dev:debug
|
||||
|
||||
## onlyoffice
|
||||
|
||||
docker run -i -t -d -p 8081:80 --restart=always -e JWT_ENABLED=false onlyoffice/documentserver
|
||||
|
||||
## next em rede
|
||||
|
||||
```
|
||||
npx next dev -H 0.0.0.0
|
||||
```
|
||||
|
||||
```
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"dev:lan": "next dev -H 0.0.0.0" <-- Adicione esta linha
|
||||
},
|
||||
```
|
||||
|
||||
Como acessar no outro dispositivo
|
||||
Descubra seu IP Local:
|
||||
|
||||
No Windows (seu caso), abra um terminal (CMD ou PowerShell) e digite:
|
||||
|
||||
Bash
|
||||
|
||||
ipconfig
|
||||
Procure por Endereço IPv4 (geralmente começa com 192.168.x.x ou 10.0.x.x).
|
||||
|
||||
Acesse no navegador: No celular ou outro computador, digite: http://SEU_IP_AQUI:3000
|
||||
|
||||
Exemplo: <http://192.168.0.15:3000>
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import next from 'eslint-config-next';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
|
||||
export default [
|
||||
next,
|
||||
{
|
||||
plugins: {
|
||||
import: importPlugin,
|
||||
},
|
||||
rules: {
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index']],
|
||||
'newlines-between': 'always',
|
||||
alphabetize: { order: 'asc', caseInsensitive: true },
|
||||
},
|
||||
],
|
||||
semi: ['error', 'always'],
|
||||
quotes: ['error', 'double'],
|
||||
},
|
||||
},
|
||||
];
|
||||
70
eslint.config.mjs
Normal file
70
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
import js from '@eslint/js';
|
||||
import reactPlugin from 'eslint-plugin-react';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx'],
|
||||
ignores: ['node_modules/**', '.next/**', 'out/**', 'dist/**'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
globals: {
|
||||
React: true,
|
||||
JSX: true,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
react: reactPlugin,
|
||||
'react-hooks': reactHooks,
|
||||
'jsx-a11y': jsxA11y,
|
||||
import: importPlugin,
|
||||
},
|
||||
settings: {
|
||||
react: { version: 'detect' },
|
||||
'import/resolver': {
|
||||
typescript: {
|
||||
alwaysTryTypes: true,
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
node: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
},
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/jsx-uses-react': 'off',
|
||||
'react/jsx-uses-vars': 'warn',
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: [['builtin', 'external'], ['internal'], ['parent', 'sibling', 'index']],
|
||||
pathGroups: [
|
||||
{
|
||||
pattern: '@/**',
|
||||
group: 'internal',
|
||||
position: 'after',
|
||||
},
|
||||
],
|
||||
alphabetize: { order: 'asc', caseInsensitive: true },
|
||||
'newlines-between': 'always',
|
||||
},
|
||||
],
|
||||
'import/no-duplicates': 'error',
|
||||
'import/newline-after-import': ['error', { count: 1 }],
|
||||
'no-unused-vars': 'warn',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
@ -1,8 +1,17 @@
|
|||
import type { NextConfig } from 'next';
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Isso gera um diretório otimizado que inclui tudo o que a aplicação precisa para rodar
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Gera build autônomo para rodar com "node server.js"
|
||||
output: 'standalone',
|
||||
|
||||
// Configurações gerais
|
||||
reactStrictMode: true,
|
||||
poweredByHeader: false,
|
||||
compress: true,
|
||||
|
||||
// Desativa verificações no build de produção
|
||||
eslint: { ignoreDuringBuilds: true },
|
||||
typescript: { ignoreBuildErrors: true },
|
||||
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
module.exports = nextConfig;
|
||||
|
|
|
|||
2666
package-lock.json
generated
2666
package-lock.json
generated
File diff suppressed because it is too large
Load diff
37
package.json
37
package.json
|
|
@ -4,16 +4,17 @@
|
|||
"version": "25.9.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"dev": "next dev",
|
||||
"dev:debug": "cross-env NEXT_USE_TURBOPACK=0 NODE_OPTIONS=\"--inspect=9230\" next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"format": "prettier --write . --ignore-path .gitignore"
|
||||
"postinstall": "shx mkdir -p public/libs && shx cp -r node_modules/tinymce public/libs/tinymce"
|
||||
},
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^10.0.0",
|
||||
"@hookform/resolvers": "^5.2.1",
|
||||
"@onlyoffice/document-editor-react": "^2.1.1",
|
||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||
"@radix-ui/react-avatar": "^1.1.10",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
|
|
@ -22,9 +23,13 @@
|
|||
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
||||
"@radix-ui/react-label": "^2.1.7",
|
||||
"@radix-ui/react-popover": "^1.1.15",
|
||||
"@radix-ui/react-progress": "^1.1.7",
|
||||
"@radix-ui/react-radio-group": "^1.3.8",
|
||||
"@radix-ui/react-scroll-area": "^1.2.10",
|
||||
"@radix-ui/react-select": "^2.2.6",
|
||||
"@radix-ui/react-separator": "^1.1.7",
|
||||
"@radix-ui/react-slot": "^1.2.3",
|
||||
"@radix-ui/react-separator": "^1.1.8",
|
||||
"@radix-ui/react-slot": "^1.2.4",
|
||||
"@radix-ui/react-switch": "^1.2.6",
|
||||
"@radix-ui/react-tabs": "^1.1.13",
|
||||
"@radix-ui/react-tooltip": "^1.2.8",
|
||||
"@tanstack/react-table": "^8.21.3",
|
||||
|
|
@ -33,7 +38,9 @@
|
|||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"cookies-next": "^6.1.0",
|
||||
"date-fns": "^3.6.0",
|
||||
"faker-js": "^1.0.0",
|
||||
"framer-motion": "^12.23.24",
|
||||
"input-otp": "^1.4.2",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
|
|
@ -45,32 +52,38 @@
|
|||
"react-dom": "19.1.0",
|
||||
"react-hook-form": "^7.62.0",
|
||||
"react-masked-text": "^1.0.5",
|
||||
"recharts": "^2.15.4",
|
||||
"recharts": "^3.3.0",
|
||||
"sonner": "^2.0.7",
|
||||
"tailwind-merge": "^3.3.1",
|
||||
"tinymce": "^8.1.2",
|
||||
"zod": "^4.0.17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.12.0",
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/date-fns": "^2.5.3",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/jsonwebtoken": "^9.0.10",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"@typescript-eslint/eslint-plugin": "^8.45.0",
|
||||
"@typescript-eslint/parser": "^8.45.0",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-next": "^15.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||
"@typescript-eslint/parser": "^8.46.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"eslint": "^9.38.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||
"shx": "^0.4.0",
|
||||
"tailwindcss": "^4",
|
||||
"tw-animate-css": "^1.3.7",
|
||||
"typescript": "5.9.3"
|
||||
"typescript": "5.9.3",
|
||||
"typescript-eslint": "^8.46.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
public/modelo.docx
Normal file
BIN
public/modelo.docx
Normal file
Binary file not shown.
BIN
public/sounds/success.mp3
Normal file
BIN
public/sounds/success.mp3
Normal file
Binary file not shown.
|
|
@ -1,51 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useGUsuarioReadHooks } from '@/app/(protected)/(administrativo)/_hooks/g_usuario/useGUsuarioReadHooks';
|
||||
import Usuario from '@/app/(protected)/(administrativo)/_interfaces/GUsuarioInterface';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
export default function UsuarioDetalhes() {
|
||||
const params = useParams();
|
||||
|
||||
const { usuario, fetchUsuario } = useGUsuarioReadHooks();
|
||||
|
||||
useEffect(() => {
|
||||
if (params.id) {
|
||||
fetchUsuario({ usuario_id: Number(params.id) } as Usuario);
|
||||
}
|
||||
console.log('pagina', usuario);
|
||||
}, []);
|
||||
|
||||
if (!usuario) return <Loading type={1} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="mb-4 grid grid-cols-4 gap-4">
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Nome</div>
|
||||
<div className="text-xl">{usuario?.nome_completo}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">CPF</div>
|
||||
<div className="text-xl">{usuario?.cpf}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Função</div>
|
||||
<div className="text-xl">{usuario?.funcao}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Email</div>
|
||||
<div className="text-xl">{usuario?.email}</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { GUsuarioSchema } from '../../../_schemas/GUsuarioSchema';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
|
||||
import { useGUsuarioSaveHook } from '../../../_hooks/g_usuario/useGUsuarioSaveHook';
|
||||
|
||||
type FormValues = z.infer<typeof GUsuarioSchema>;
|
||||
|
||||
export default function UsuarioFormularioPage() {
|
||||
const { usuario, saveUsuario } = useGUsuarioSaveHook();
|
||||
|
||||
const form = useForm<FormValues>({
|
||||
resolver: zodResolver(GUsuarioSchema),
|
||||
defaultValues: {
|
||||
login: '',
|
||||
nome_completo: '',
|
||||
funcao: '',
|
||||
email: '',
|
||||
cpf: '',
|
||||
},
|
||||
});
|
||||
|
||||
async function onSubmit(values: FormValues) {
|
||||
saveUsuario(values);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="login"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Login</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="nome_completo"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Nome Completo</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="funcao"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Função</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="email"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Email</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cpf"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Cpf</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Button type="submit">Salvar</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
|
||||
import Usuario from '../../_interfaces/GUsuarioInterface';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import Link from 'next/link';
|
||||
import { useGUsuarioIndexHook } from '../../_hooks/g_usuario/useGUsuarioIndexHook';
|
||||
import { useEffect } from 'react';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
export default function UsuarioPage() {
|
||||
const { usuarios, fetchUsuarios } = useGUsuarioIndexHook();
|
||||
|
||||
useEffect(() => {
|
||||
fetchUsuarios();
|
||||
}, []);
|
||||
|
||||
if (!usuarios) return <Loading type={2} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-2">
|
||||
<div className="text-2xl font-semibold">Usuarios</div>
|
||||
<div className="text-right">
|
||||
<Button asChild>
|
||||
<Link href="/usuarios/formulario">+ Usuário</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className="text-center">#</TableHead>
|
||||
<TableHead>Situação</TableHead>
|
||||
<TableHead>CPF</TableHead>
|
||||
<TableHead>Login / Sigla / Nome</TableHead>
|
||||
<TableHead>Função</TableHead>
|
||||
<TableHead></TableHead>
|
||||
<TableHead></TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{usuarios.map((usuario: Usuario) => (
|
||||
<TableRow key={usuario.usuario_id} className="cursor-pointer">
|
||||
<TableCell className="text-center">{usuario.usuario_id}</TableCell>
|
||||
<TableCell className="font-medium">{usuario.situacao}</TableCell>
|
||||
<TableCell className="font-medium">{usuario.cpf}</TableCell>
|
||||
<TableCell>
|
||||
<div className="text-xs font-semibold">
|
||||
{usuario.login} - {usuario.sigla}
|
||||
</div>
|
||||
<div className="text-base">{usuario.nome_completo}</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div className="text-base">{usuario.funcao}</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Button asChild>
|
||||
<Link href={`/usuarios/${usuario.usuario_id}/detalhes`}>Detalhes</Link>
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
'use server';
|
||||
|
||||
import GUsuarioIndexData from '../../_data/g_usuario/GUsuarioIndexData';
|
||||
|
||||
export default async function GUsuarioIndex() {
|
||||
const response = await GUsuarioIndexData();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
'use server';
|
||||
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
import GUsuarioLoginData from '../../_data/g_usuario/GUsuarioLoginData';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export default async function GUsuarioLoginService(form: any) {
|
||||
// Obtem a resposta da requisição
|
||||
const response = await GUsuarioLoginData(form);
|
||||
|
||||
// Verifica se localizou o usuário
|
||||
if (response.data.usuario_id <= 0) {
|
||||
return {
|
||||
code: 404,
|
||||
message: 'Não foi localizado o usuário',
|
||||
};
|
||||
}
|
||||
|
||||
// Importação do manipulador de cookies
|
||||
const cookieStore = await cookies();
|
||||
|
||||
// Cria um novo cookie
|
||||
cookieStore.set('access_token', response.data.token, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
sameSite: 'strict',
|
||||
path: '/',
|
||||
maxAge: 60 * 60 * 24,
|
||||
});
|
||||
|
||||
// Redireciona para a págian desejada
|
||||
redirect('/servicos');
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
'use server';
|
||||
|
||||
import GUsuarioReadData from '../../_data/g_usuario/GUsuarioReadData';
|
||||
|
||||
export default async function GUsuarioRead(usuarioId: number) {
|
||||
// Verifica se o id informado é válido
|
||||
if (usuarioId <= 0) {
|
||||
return {
|
||||
code: 400,
|
||||
message: 'Usuário informado inválido',
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await GUsuarioReadData(usuarioId);
|
||||
console.log('service', response);
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TTBAndamentoServicoIndex from '@/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex';
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
return <TTBAndamentoServicoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TAtoParteTipoIndex from '@/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex';
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
return <TAtoParteTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBBairroIndex from '@/packages/administrativo/components/GTBBairro/GTBBairroIndex';
|
||||
|
||||
export default function GCidadePage() {
|
||||
return <GTBBairroIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GCartorioIndex from '@/packages/administrativo/components/GCartorio/GCartorioIndex';
|
||||
|
||||
export default function GCartorioPage() {
|
||||
return <GCartorioIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecTipoNaturezaIndex from '@/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex';
|
||||
|
||||
export default function TCensecTipoNaturezaPage() {
|
||||
return <TCensecTipoNaturezaIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default function TCensecPage() {
|
||||
return <div></div>;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecQualidadeIndex from '@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex';
|
||||
|
||||
export default function TCensecQualidadePage() {
|
||||
return <TCensecQualidadeIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecIndex from '@/packages/administrativo/components/TCensec/TCensecIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <TCensecIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecNaturezaLitigioIndex from '@/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex';
|
||||
|
||||
export default function GCidadePage() {
|
||||
return <TCensecNaturezaLitigioIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecQualidadeIndex from '@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <TCensecQualidadeIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecTipoAtoIndex from '@/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <TCensecTipoAtoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GCidadeIndex from '@/packages/administrativo/components/GCidade/GCidadeIndex';
|
||||
|
||||
export default function GCidadePage() {
|
||||
return <GCidadeIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GCalculoIndex from '@/packages/administrativo/components/GCalculo/GCalculoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GCalculoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import GEmolumentoItemIndex from '@/packages/administrativo/components/GEmolumentoItem/GEmolumentoItemIndex';
|
||||
|
||||
export default function GGramaticaPage() {
|
||||
const params = useParams();
|
||||
|
||||
return (
|
||||
<GEmolumentoItemIndex
|
||||
emolumento_id={Number(params.emolumentoId)}
|
||||
emolumento_periodo_id={Number(params.emolumentoPeriodoId)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GEmolumentoIndex from '@/packages/administrativo/components/GEmolumento/GEmolumentoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GEmolumentoPeriodoIndex from '@/packages/administrativo/components/GEmolumentoPeriodo/GEmolumentoPeriodoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoPeriodoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GGramaticaIndex from '@/packages/administrativo/components/GGramatica/GGramaticaIndex';
|
||||
|
||||
export default function GGramaticaPage() {
|
||||
return <GGramaticaIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TImovelDashboard from '@/packages/administrativo/components/TImovel/TImovelDashboard';
|
||||
|
||||
export default function TImovelDashboardPage() {
|
||||
return <TImovelDashboard />;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import TImovelIndex from "@/packages/administrativo/components/TImovel/TImovelIndex";
|
||||
import TImovelIndex from '@/packages/administrativo/components/TImovel/TImovelIndex';
|
||||
|
||||
export default function TImovelRuralPage() {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBTipoLogradouroIndex from '@/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex';
|
||||
|
||||
export default function GMedidaTipoPage() {
|
||||
return <GTBTipoLogradouroIndex />;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import TImovelIndex from "@/packages/administrativo/components/TImovel/TImovelIndex";
|
||||
import TImovelIndex from '@/packages/administrativo/components/TImovel/TImovelIndex';
|
||||
|
||||
export default function TImovelUrbanoPage() {
|
||||
return (
|
||||
|
|
@ -10,4 +10,4 @@ export default function TImovelUrbanoPage() {
|
|||
tipoClasse={1}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GMedidaTipoIndex from '@/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex';
|
||||
|
||||
export default function GMedidaTipoPage() {
|
||||
return <GMedidaTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GNaturezaIndex from '@/packages/administrativo/components/GNatureza/GNaturezaIndex';
|
||||
|
||||
export default function GNaturezaPage() {
|
||||
return <GNaturezaIndex sistema_id={2} />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TPessoaDashboard from '@/packages/administrativo/components/TPessoa/TPessoaDashboard';
|
||||
|
||||
export default function TPessoaDashboardPage() {
|
||||
return <TPessoaDashboard />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBEstadoCivilIndex from '@/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <GTBEstadoCivilIndex />;
|
||||
}
|
||||
|
|
@ -3,7 +3,5 @@
|
|||
import TPessoaFisicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaIndex';
|
||||
|
||||
export default function TPessoaFisica() {
|
||||
return (
|
||||
<TPessoaFisicaIndex />
|
||||
);
|
||||
return <TPessoaFisicaIndex />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,5 @@
|
|||
import TPessoaJuridicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaIndex';
|
||||
|
||||
export default function TPessoaFisica() {
|
||||
|
||||
return (
|
||||
<TPessoaJuridicaIndex />
|
||||
);
|
||||
return <TPessoaJuridicaIndex />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBProfissaoIndex from '@/packages/administrativo/components/GTBProfissao/GTBProfissaoIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <GTBProfissaoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBRegimeBensIndex from '@/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensIndex';
|
||||
|
||||
export default function GTBRegimeBensPage() {
|
||||
return <GTBRegimeBensIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBRegimeComunhaoIndex from '@/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex';
|
||||
|
||||
export default function GTBRegimeBensPage() {
|
||||
return <GTBRegimeComunhaoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TTBReconhecimentoTipoIndex from '@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndex';
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
return <TTBReconhecimentoTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GSeloGrupoIndex from '@/packages/administrativo/components/GSeloGrupo/GSeloGrupoIndex';
|
||||
|
||||
export default function GSeloGrupoPage() {
|
||||
return <GSeloGrupoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TServicoTipoIndex from '@/packages/administrativo/components/TServicoTipo/TServicoTipoIndex';
|
||||
|
||||
export default function TServicoTipoPage() {
|
||||
return <TServicoTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GNaturezaTituloIndex from '@/packages/administrativo/components/GNaturezaTitulo/GNaturezaTituloIndex';
|
||||
|
||||
export default function GNaturezaPage() {
|
||||
return <GNaturezaTituloIndex sistema_id={2} />;
|
||||
}
|
||||
|
|
@ -1,14 +1,13 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import { useTMinutaReadHook } from '../../../../_hooks/t_minuta/useTMinutaReadHook';
|
||||
import { TMinutaInterface } from '../../../../_interfaces/TMinutaInterface';
|
||||
|
||||
export default function TMinutaDetalhes() {
|
||||
const params = useParams();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
'use client';
|
||||
|
||||
import z from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useEffect } from 'react';
|
||||
import { useForm, Controller } from 'react-hook-form';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import z from 'zod';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import {
|
||||
Form,
|
||||
|
|
@ -17,11 +19,8 @@ import {
|
|||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { TMinutaSchema } from '../../../_schemas/TMinutaSchema';
|
||||
import { useTMinutaSaveHook } from '../../../_hooks/t_minuta/useTMinutaSaveHook';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { TMinutaSchema } from '@/packages/administrativo/schemas/TMinuta/TMinutaSchema';
|
||||
|
||||
type FormValues = z.infer<typeof TMinutaSchema>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,19 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
||||
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
||||
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import TMinutaTable from '../../_components/t_minuta/TMinutaTable';
|
||||
import TMinutaForm from '../../_components/t_minuta/TMinutaForm';
|
||||
|
||||
import { useTMinutaReadHook } from '../../_hooks/t_minuta/useTMinutaReadHook';
|
||||
import { useTMinutaSaveHook } from '../../_hooks/t_minuta/useTMinutaSaveHook';
|
||||
import { useTMinutaRemoveHook } from '../../_hooks/t_minuta/useTMinutaRemoveHook';
|
||||
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
import { useTMinutaIndexHook } from '../../_hooks/t_minuta/useTMinutaIndexHook';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function TMinutaPage() {
|
||||
// Hooks de leitura e escrita
|
||||
|
|
|
|||
|
|
@ -1,278 +0,0 @@
|
|||
'use client'
|
||||
|
||||
import React, { useMemo, useState } from "react";
|
||||
import {
|
||||
Card,
|
||||
CardTitle,
|
||||
CardContent,
|
||||
} from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
PieChart,
|
||||
Pie,
|
||||
Cell,
|
||||
ResponsiveContainer,
|
||||
BarChart,
|
||||
Bar,
|
||||
XAxis,
|
||||
YAxis,
|
||||
Tooltip,
|
||||
Legend,
|
||||
} from "recharts";
|
||||
|
||||
// Função de agregação
|
||||
function sampleAggregations(data) {
|
||||
const bySexo: Record<string, number> = {};
|
||||
const byUF: Record<string, number> = {};
|
||||
const byProf: Record<string, number> = {};
|
||||
const byEstCivil: Record<string, number> = {};
|
||||
const byInstr: Record<string, number> = {};
|
||||
const docsExpiry: any[] = [];
|
||||
|
||||
const now = new Date();
|
||||
for (const p of data) {
|
||||
const sexo = p.SEXO || "Não informado";
|
||||
bySexo[sexo] = (bySexo[sexo] || 0) + 1;
|
||||
|
||||
const uf = p.UF_RESIDENCIA || p.UF || "Não informado";
|
||||
byUF[uf] = (byUF[uf] || 0) + 1;
|
||||
|
||||
const prof = p.TB_PROFISSAO_ID || "Outros";
|
||||
byProf[prof] = (byProf[prof] || 0) + 1;
|
||||
|
||||
const ec = p.TB_ESTADOCIVIL_ID || "Não informado";
|
||||
byEstCivil[ec] = (byEstCivil[ec] || 0) + 1;
|
||||
|
||||
const gi = p.GRAU_INSTRUCAO || "Não informado";
|
||||
byInstr[gi] = (byInstr[gi] || 0) + 1;
|
||||
|
||||
if (p.DOCUMENTO_VALIDADE) {
|
||||
const dv = new Date(p.DOCUMENTO_VALIDADE);
|
||||
const days = Math.ceil((dv.getTime() - now.getTime()) / (1000 * 60 * 60 * 24));
|
||||
docsExpiry.push({
|
||||
id: p.PESSOA_ID || p.DOCUMENTO_NUMERO || Math.random(),
|
||||
days,
|
||||
date: p.DOCUMENTO_VALIDADE
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
sexo: Object.entries(bySexo).map(([key, value]) => ({ name: key, value })),
|
||||
uf: Object.entries(byUF).map(([key, value]) => ({ name: key, value })),
|
||||
prof: Object.entries(byProf)
|
||||
.map(([key, value]) => ({ name: String(key), value }))
|
||||
.sort((a, b) => b.value - a.value)
|
||||
.slice(0, 10),
|
||||
estCivil: Object.entries(byEstCivil).map(([key, value]) => ({ name: key, value })),
|
||||
instr: Object.entries(byInstr).map(([key, value]) => ({ name: key, value })),
|
||||
docsExpiry,
|
||||
};
|
||||
}
|
||||
|
||||
// Paleta
|
||||
const COLORS = [
|
||||
"#4F46E5",
|
||||
"#06B6D4",
|
||||
"#F59E0B",
|
||||
"#EF4444",
|
||||
"#10B981",
|
||||
"#8B5CF6",
|
||||
"#F97316",
|
||||
"#6366F1",
|
||||
"#EC4899",
|
||||
"#334155",
|
||||
];
|
||||
|
||||
export default function PessoasDashboard({ dataset = null }) {
|
||||
const mock = useMemo(() => {
|
||||
if (dataset) return dataset;
|
||||
// Mock realista
|
||||
const nomes = ["Ana Clara", "Bruno Silva", "Carlos Souza", "Daniela Oliveira", "Eduardo Lima", "Fernanda Rocha", "Gustavo Alves", "Helena Martins"];
|
||||
const sexos = ["Masculino", "Feminino", "Outro"];
|
||||
const ufs = ["São Paulo", "Rio de Janeiro", "Minas Gerais", "Goiás", "Distrito Federal"];
|
||||
const profs = ["Advogado", "Professor", "Agricultor", "Engenheiro Civil", "Estudante Universitário", "Médico", "Enfermeiro", "Empresário"];
|
||||
const estc = ["Solteiro(a)", "Casado(a)", "Divorciado(a)", "Viúvo(a)", "União Estável"];
|
||||
const instrucao = ["Ensino Fundamental", "Ensino Médio", "Ensino Superior", "Pós-Graduação", "Mestrado", "Doutorado"];
|
||||
const arr: any[] = [];
|
||||
for (let i = 0; i < 200; i++) {
|
||||
const birth = new Date(1960 + Math.floor(Math.random() * 50), Math.floor(Math.random() * 12), Math.floor(Math.random() * 28) + 1);
|
||||
const docVal = new Date();
|
||||
docVal.setFullYear(docVal.getFullYear() + Math.floor(Math.random() * 5));
|
||||
arr.push({
|
||||
PESSOA_ID: i + 1,
|
||||
NOME: nomes[Math.floor(Math.random() * nomes.length)],
|
||||
SEXO: sexos[Math.floor(Math.random() * sexos.length)],
|
||||
UF_RESIDENCIA: ufs[Math.floor(Math.random() * ufs.length)],
|
||||
TB_PROFISSAO_ID: profs[Math.floor(Math.random() * profs.length)],
|
||||
TB_ESTADOCIVIL_ID: estc[Math.floor(Math.random() * estc.length)],
|
||||
GRAU_INSTRUCAO: instrucao[Math.floor(Math.random() * instrucao.length)],
|
||||
DOCUMENTO_VALIDADE: docVal.toISOString().slice(0, 10),
|
||||
DATA_NASCIMENTO: birth.toISOString().slice(0, 10),
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
}, [dataset]);
|
||||
|
||||
const aggregations = useMemo(() => sampleAggregations(mock), [mock]);
|
||||
|
||||
return (
|
||||
<div className="p-6 space-y-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-2xl font-semibold">Dashboard de Pessoas</h1>
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={() => {}}>Exportar CSV</Button>
|
||||
<Button variant="ghost" onClick={() => window.location.reload()}>Atualizar</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Linha 1 */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-4">
|
||||
<Card>
|
||||
<CardTitle>Distribuição por Sexo</CardTitle>
|
||||
<CardContent className="h-64 p-4">
|
||||
<ResponsiveContainer>
|
||||
<PieChart>
|
||||
<Pie data={aggregations.sexo} dataKey="value" nameKey="name" outerRadius={80} label>
|
||||
{aggregations.sexo.map((entry, index) => (
|
||||
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
||||
))}
|
||||
</Pie>
|
||||
<Tooltip />
|
||||
</PieChart>
|
||||
</ResponsiveContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardTitle>Idade (faixas etárias)</CardTitle>
|
||||
<CardContent className="h-64 p-4">
|
||||
<ResponsiveContainer>
|
||||
<BarChart data={(() => {
|
||||
const now = new Date();
|
||||
const ages = mock.map((p) => {
|
||||
const d = p.DATA_NASCIMENTO ? new Date(p.DATA_NASCIMENTO) : null;
|
||||
if (!d) return null;
|
||||
return Math.floor((now.getTime() - d.getTime()) / (1000 * 60 * 60 * 24 * 365.25));
|
||||
}).filter(Boolean) as number[];
|
||||
const buckets = ["0-17","18-25","26-35","36-45","46-60","61+"];
|
||||
const counts: Record<string, number> = {"0-17":0,"18-25":0,"26-35":0,"36-45":0,"46-60":0,"61+":0};
|
||||
for (const a of ages) {
|
||||
if (a<=17) counts['0-17']++;
|
||||
else if (a<=25) counts['18-25']++;
|
||||
else if (a<=35) counts['26-35']++;
|
||||
else if (a<=45) counts['36-45']++;
|
||||
else if (a<=60) counts['46-60']++;
|
||||
else counts['61+']++;
|
||||
}
|
||||
return buckets.map(b => ({ bucket: b, value: counts[b]}));
|
||||
})()}>
|
||||
<XAxis dataKey="bucket" />
|
||||
<YAxis />
|
||||
<Tooltip />
|
||||
<Bar dataKey="value" fill={COLORS[0]} />
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardTitle>Top Profissões</CardTitle>
|
||||
<CardContent className="h-64 p-4">
|
||||
<ResponsiveContainer>
|
||||
<BarChart data={aggregations.prof} layout="vertical">
|
||||
<XAxis type="number" />
|
||||
<YAxis dataKey="name" type="category" />
|
||||
<Tooltip />
|
||||
<Bar dataKey="value" fill={COLORS[3]} />
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* Linha 2 */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
<Card>
|
||||
<CardTitle>Distribuição por Unidade Federativa</CardTitle>
|
||||
<CardContent className="h-72 p-4">
|
||||
<ResponsiveContainer>
|
||||
<BarChart data={aggregations.uf}>
|
||||
<XAxis dataKey="name" />
|
||||
<YAxis />
|
||||
<Tooltip />
|
||||
<Bar dataKey="value" fill={COLORS[1]} />
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardTitle>Documentos próximos ao vencimento</CardTitle>
|
||||
<CardContent className="h-72 p-4 overflow-auto">
|
||||
<ul className="text-sm space-y-2">
|
||||
{aggregations.docsExpiry
|
||||
.sort((a,b) => a.days - b.days)
|
||||
.slice(0, 15)
|
||||
.map((d) => (
|
||||
<li key={d.id} className="flex justify-between">
|
||||
<div>Documento #{d.id}</div>
|
||||
<div>{d.date} ({d.days} dias)</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* Linha 3 */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-4">
|
||||
<Card>
|
||||
<CardTitle>Estado Civil</CardTitle>
|
||||
<CardContent className="h-56 p-4">
|
||||
<ResponsiveContainer>
|
||||
<PieChart>
|
||||
<Pie data={aggregations.estCivil} dataKey="value" nameKey="name" outerRadius={70} label />
|
||||
<Tooltip />
|
||||
</PieChart>
|
||||
</ResponsiveContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardTitle>Grau de Instrução</CardTitle>
|
||||
<CardContent className="h-56 p-4">
|
||||
<ResponsiveContainer>
|
||||
<BarChart data={aggregations.instr}>
|
||||
<XAxis dataKey="name" />
|
||||
<YAxis />
|
||||
<Tooltip />
|
||||
<Bar dataKey="value" fill={COLORS[2]} />
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardTitle>Documentos por Tipo (placeholder)</CardTitle>
|
||||
<CardContent className="h-56 p-4">
|
||||
<ResponsiveContainer>
|
||||
<BarChart data={aggregations.prof /* trocar por tipos de documento no dataset real */}>
|
||||
<XAxis dataKey="name" />
|
||||
<YAxis />
|
||||
<Tooltip />
|
||||
<Bar dataKey="value" fill={COLORS[4]} />
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div className="mt-6">
|
||||
<small className="text-muted text-sm">
|
||||
Dica: ao conectar seu dataset real, ajuste o mapeamento em <code>sampleAggregations</code> (por exemplo, <b>TB_PROFISSAO_ID → nome da profissão</b>, <b>TB_ESTADOCIVIL_ID → descrição</b>).
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,271 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
import TTBReconhecimentoTipoTable from '../../_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoTable';
|
||||
import TTBReconhecimentoTipoForm from '../../_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoForm';
|
||||
|
||||
import { useTTBReconhecimentoTipoReadHook } from '../../_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoReadHook';
|
||||
import { useTTBReconhecimentoTipoSaveHook } from '../../_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoSaveHook';
|
||||
import { useTTBReconhecimentoTipoDeleteHook } from '../../_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoDeleteHook';
|
||||
|
||||
<<<<<<< HEAD
|
||||
import ConfirmExclusion from "@/app/_components/confirm_exclusion/ConfirmExclusion";
|
||||
import { useConfirmExclusion } from "@/app/_components/confirm_exclusion/useConfirmExclusion";
|
||||
=======
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
>>>>>>> origin/release(MVP/Sprint6)
|
||||
|
||||
import TTBReconhecimentoTipoInterface from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { tTBReconhecimentosTipos, fetchTTBReconhecimentosTipos } =
|
||||
useTTBReconhecimentoTipoReadHook();
|
||||
const { saveTTBReconhecimentoTipo } = useTTBReconhecimentoTipoSaveHook();
|
||||
const { deleteTTBReconhecimentoTipo } = useTTBReconhecimentoTipoDeleteHook();
|
||||
|
||||
// Estados
|
||||
const [selectedReconhecimentoTipo, setReconhecimentoTipo] =
|
||||
useState<TTBReconhecimentoTipoInterface | null>(null);
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
|
||||
// Estado para saber qual item será deletado
|
||||
const [itemToDelete, setItemToDelete] = useState<TTBReconhecimentoTipoInterface | null>(null);
|
||||
|
||||
/**
|
||||
* Hook do modal de confirmação
|
||||
*/
|
||||
const {
|
||||
isOpen: isConfirmOpen,
|
||||
openDialog: openConfirmDialog,
|
||||
handleConfirm,
|
||||
handleCancel,
|
||||
} = useConfirmDialog();
|
||||
|
||||
<<<<<<< HEAD
|
||||
/**
|
||||
* Hook do modal de exclusão com OTP
|
||||
*/
|
||||
const {
|
||||
isOpen: isConfirmOpen,
|
||||
openDialog: openConfirmDialog,
|
||||
handleConfirm,
|
||||
handleCancel,
|
||||
code,
|
||||
isValid,
|
||||
handleChange,
|
||||
} = useConfirmExclusion({
|
||||
expectedCode: "123456", // 🔑 aqui você define o código esperado
|
||||
onConfirm: () => {
|
||||
console.log("Confirmação aceita com código OTP válido");
|
||||
},
|
||||
onCancel: () => {
|
||||
console.log("Ação cancelada");
|
||||
},
|
||||
});
|
||||
|
||||
=======
|
||||
/**
|
||||
* Abre o formulário no modo de edição ou criação
|
||||
*/
|
||||
const handleOpenForm = useCallback((data: TTBReconhecimentoTipoInterface | null) => {
|
||||
setReconhecimentoTipo(data);
|
||||
setIsFormOpen(true);
|
||||
}, []);
|
||||
>>>>>>> origin/release(MVP/Sprint6)
|
||||
|
||||
/**
|
||||
* Fecha o formulário e limpa o andamento selecionado
|
||||
*/
|
||||
const handleCloseForm = useCallback(() => {
|
||||
setReconhecimentoTipo(null);
|
||||
setIsFormOpen(false);
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Salva os dados do formulário
|
||||
*/
|
||||
const handleSave = useCallback(
|
||||
async (formData: TTBReconhecimentoTipoInterface) => {
|
||||
// Aguarda salvar o registro
|
||||
await saveTTBReconhecimentoTipo(formData);
|
||||
|
||||
// Atualiza a lista de dados
|
||||
fetchTTBReconhecimentosTipos();
|
||||
},
|
||||
[saveTTBReconhecimentoTipo, fetchTTBReconhecimentosTipos],
|
||||
);
|
||||
|
||||
/**
|
||||
* Quando o usuário clica em "remover" na tabela
|
||||
*/
|
||||
const handleConfirmDelete = useCallback(
|
||||
(item: TTBReconhecimentoTipoInterface) => {
|
||||
// Define o item atual para remoção
|
||||
setItemToDelete(item);
|
||||
|
||||
// Abre o modal de confirmação
|
||||
openConfirmDialog();
|
||||
},
|
||||
[openConfirmDialog],
|
||||
);
|
||||
|
||||
/**
|
||||
* Executa a exclusão de fato quando o usuário confirma
|
||||
*/
|
||||
const handleDelete = useCallback(async () => {
|
||||
// Protege contra null
|
||||
if (!itemToDelete) return;
|
||||
|
||||
// Executa o Hook de remoção
|
||||
await deleteTTBReconhecimentoTipo(itemToDelete);
|
||||
|
||||
// Atualiza a lista
|
||||
await fetchTTBReconhecimentosTipos();
|
||||
|
||||
<<<<<<< HEAD
|
||||
// Abre o modal de exclusão
|
||||
openConfirmDialog();
|
||||
=======
|
||||
// Limpa o item selecionado
|
||||
setItemToDelete(null);
|
||||
>>>>>>> origin/release(MVP/Sprint6)
|
||||
|
||||
// Fecha o modal
|
||||
handleCancel();
|
||||
}, [itemToDelete, fetchTTBReconhecimentosTipos, handleCancel]);
|
||||
|
||||
/**
|
||||
* Busca inicial dos dados
|
||||
*/
|
||||
useEffect(() => {
|
||||
fetchTTBReconhecimentosTipos();
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Tela de loading enquanto carrega os dados
|
||||
*/
|
||||
if (!tTBReconhecimentosTipos) {
|
||||
return <Loading type={2} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* Cabeçalho */}
|
||||
<Header
|
||||
title={'Reconhecimentos'}
|
||||
description={'Gerenciamento de tipos de reconhecimentos'}
|
||||
buttonText={'Novo Tipo'}
|
||||
buttonAction={() => {
|
||||
handleOpenForm(null);
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Tabela de andamentos */}
|
||||
<Card>
|
||||
<CardContent>
|
||||
<TTBReconhecimentoTipoTable
|
||||
data={tTBReconhecimentosTipos}
|
||||
onEdit={handleOpenForm}
|
||||
onDelete={handleConfirmDelete}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Modal de confirmação */}
|
||||
<ConfirmDialog
|
||||
isOpen={isConfirmOpen}
|
||||
title="Confirmar exclusão"
|
||||
description="Atenção"
|
||||
message={`Deseja realmente excluir o andamento "${itemToDelete?.descricao}"?`}
|
||||
confirmText="Sim, excluir"
|
||||
cancelText="Cancelar"
|
||||
onConfirm={handleDelete}
|
||||
onCancel={handleCancel}
|
||||
/>
|
||||
|
||||
<<<<<<< HEAD
|
||||
// Fecha o modal
|
||||
handleCancel();
|
||||
|
||||
}, [itemToDelete, fetchTTBReconhecimentosTipos, handleCancel]);
|
||||
|
||||
const handleResendCode = (async () => {
|
||||
return alert("Reenviando código de exclusão")
|
||||
})
|
||||
|
||||
/**
|
||||
* Busca inicial dos dados
|
||||
*/
|
||||
useEffect(() => {
|
||||
fetchTTBReconhecimentosTipos();
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Tela de loading enquanto carrega os dados
|
||||
*/
|
||||
if (!tTBReconhecimentosTipos) {
|
||||
return <Loading type={2} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* Cabeçalho */}
|
||||
<Header
|
||||
title={"Reconhecimentos"}
|
||||
description={"Gerenciamento de tipos de reconhecimentos"}
|
||||
buttonText={"Novo Tipo"}
|
||||
buttonAction={() => { handleOpenForm(null) }}
|
||||
/>
|
||||
|
||||
{/* Tabela de andamentos */}
|
||||
<Card>
|
||||
<CardContent>
|
||||
<TTBReconhecimentoTipoTable
|
||||
data={tTBReconhecimentosTipos}
|
||||
onEdit={handleOpenForm}
|
||||
onDelete={handleConfirmDelete}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Modal de confirmação de exclusão com OTP */}
|
||||
<ConfirmExclusion
|
||||
isOpen={isConfirmOpen}
|
||||
title="Confirmar exclusão"
|
||||
description="Digite o código de exclusão para confirmar:"
|
||||
confirmText="Continuar"
|
||||
cancelText="Cancelar"
|
||||
onConfirm={handleDelete}
|
||||
onCancel={handleCancel}
|
||||
expectedCode={"123456"}
|
||||
onResendCode={handleResendCode}
|
||||
/>
|
||||
|
||||
|
||||
{/* Formulário de criação/edição */}
|
||||
<TTBReconhecimentoTipoForm
|
||||
isOpen={isFormOpen}
|
||||
data={selectedReconhecimentoTipo}
|
||||
onClose={handleCloseForm}
|
||||
onSave={handleSave}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
=======
|
||||
{/* Formulário de criação/edição */}
|
||||
<TTBReconhecimentoTipoForm
|
||||
isOpen={isFormOpen}
|
||||
data={selectedReconhecimentoTipo}
|
||||
onClose={handleCloseForm}
|
||||
onSave={handleSave}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
>>>>>>> origin/release(MVP/Sprint6)
|
||||
}
|
||||
|
|
@ -1,226 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import z from "zod";
|
||||
import { useEffect } from "react";
|
||||
import { useForm, Controller } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import LoadingButton from "@/app/_components/loadingButton/LoadingButton";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle
|
||||
} from "@/components/ui/dialog";
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { TCensecTipoAtoSchema } from "../../_schemas/TCensecTipoAtoSchema";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import TCensecInterface from "../../_interfaces/TCensecInterface";
|
||||
import { SituacoesEnum } from "@/enums/SituacoesEnum";
|
||||
|
||||
type FormValues = z.infer<typeof TCensecTipoAtoSchema>;
|
||||
|
||||
interface TCensecTipoAtoFormProps {
|
||||
isOpen: boolean;
|
||||
data: FormValues | null;
|
||||
tCensec: TCensecInterface[];
|
||||
onClose: (item: null, isFormStatus: boolean) => void;
|
||||
onSave: (data: FormValues) => void;
|
||||
buttonIsLoading: boolean;
|
||||
}
|
||||
|
||||
export default function TCensecTipoAtoForm({
|
||||
isOpen,
|
||||
data,
|
||||
tCensec,
|
||||
onClose,
|
||||
onSave,
|
||||
buttonIsLoading
|
||||
}: TCensecTipoAtoFormProps) {
|
||||
// react-hook-form com schema Zod
|
||||
const form = useForm<FormValues>({
|
||||
resolver: zodResolver(TCensecTipoAtoSchema),
|
||||
defaultValues: {
|
||||
censec_tipoato_id: 0,
|
||||
censec_id: 0,
|
||||
codigo: null,
|
||||
descricao: "",
|
||||
situacao: SituacoesEnum.A,
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null,
|
||||
},
|
||||
});
|
||||
|
||||
// Atualiza o formulário se houver dados para edição
|
||||
useEffect(() => {
|
||||
if (data) form.reset(data);
|
||||
}, [data, form]);
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={isOpen}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) onClose(null, false);
|
||||
}}
|
||||
>
|
||||
<DialogContent className="sm:max-w-[500px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Tipo de Ato CENSEC</DialogTitle>
|
||||
<DialogDescription>
|
||||
Crie ou edite um tipo de ato da CENSEC
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSave)} className="space-y-6">
|
||||
|
||||
{/* Descrição */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="descricao"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Descrição</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} placeholder="Digite a descrição" />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* Select Censec */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="censec_id"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Central do Censec</FormLabel>
|
||||
<Select
|
||||
value={field.value?.toString()}
|
||||
onValueChange={(val) => field.onChange(Number(val))}
|
||||
>
|
||||
<FormControl>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="Selecione um Censec" />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent className="w-full">
|
||||
{tCensec.map((c) => (
|
||||
<SelectItem key={c.censec_id} value={String(c.censec_id)}>
|
||||
{c.descricao}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
{/* Situação */}
|
||||
<Controller
|
||||
name="situacao"
|
||||
control={form.control}
|
||||
render={({ field }) => (
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
checked={field.value === "A"}
|
||||
onCheckedChange={(checked) => field.onChange(checked ? "A" : "I")}
|
||||
/>
|
||||
<Label>Ativo</Label>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* Tipo de Separação */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tipo_separacao"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Tipo de Separação</FormLabel>
|
||||
<Select
|
||||
onValueChange={(val) => field.onChange(val || null)}
|
||||
value={field.value ?? ""}
|
||||
>
|
||||
<FormControl>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="Selecione" />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent className="w-full">
|
||||
<SelectItem value="S">Sim</SelectItem>
|
||||
<SelectItem value="N">Não</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* Tipo de Revogação */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tipo_revogacao"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Tipo de Revogação</FormLabel>
|
||||
<Select
|
||||
onValueChange={(val) => field.onChange(val || null)}
|
||||
value={field.value ?? ""}
|
||||
>
|
||||
<FormControl>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="Selecione" />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent className="w-full">
|
||||
<SelectItem value="S">Sim</SelectItem>
|
||||
<SelectItem value="N">Não</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* Rodapé */}
|
||||
<DialogFooter className="mt-4">
|
||||
<DialogClose asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
type="button"
|
||||
onClick={() => onClose(null, false)}
|
||||
className="cursor-pointer"
|
||||
>
|
||||
Cancelar
|
||||
</Button>
|
||||
</DialogClose>
|
||||
<LoadingButton text="Salvar" textLoading="Aguarde..." type="submit" loading={buttonIsLoading} />
|
||||
</DialogFooter>
|
||||
|
||||
{/* Campos ocultos */}
|
||||
<input type="hidden" {...form.register("censec_tipoato_id")} />
|
||||
<input type="hidden" {...form.register("codigo")} />
|
||||
</form>
|
||||
</Form>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
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, Trash2Icon } from "lucide-react";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import TCensecInterface from "../../_interfaces/TCensecInterface";
|
||||
|
||||
interface TCensecTipoAtoTableProps {
|
||||
data: TCensecTipoAtoInterface[];
|
||||
tCensec: TCensecInterface[];
|
||||
onEdit: (item: TCensecTipoAtoInterface, isEditingFormStatus: boolean) => void;
|
||||
onDelete: (item: TCensecTipoAtoInterface, isEditingFormStatus: boolean) => void;
|
||||
}
|
||||
|
||||
function StatusBadge({ situacao }: { situacao: string }) {
|
||||
const isActive = situacao === "A";
|
||||
|
||||
const baseClasses =
|
||||
"text-xs font-medium px-2.5 py-0.5 rounded-sm me-2";
|
||||
|
||||
const activeClasses =
|
||||
"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300";
|
||||
|
||||
const inactiveClasses =
|
||||
"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300";
|
||||
|
||||
return (
|
||||
<span className={`${baseClasses} ${isActive ? activeClasses : inactiveClasses}`}>
|
||||
{isActive ? "Ativo" : "Inativo"}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
export default function TCensecTipoAtoTable({
|
||||
data,
|
||||
tCensec,
|
||||
onEdit,
|
||||
onDelete
|
||||
}: TCensecTipoAtoTableProps) {
|
||||
return (
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>#</TableHead>
|
||||
<TableHead>Situação</TableHead>
|
||||
<TableHead>Central do CENSEC</TableHead>
|
||||
{/*<TableHead>Código</TableHead>*/}
|
||||
<TableHead>Descrição</TableHead>
|
||||
<TableHead>Separação</TableHead>
|
||||
<TableHead>Revogação</TableHead>
|
||||
<TableHead className="text-right">Ações</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
|
||||
<TableBody>
|
||||
{data.map((item) => {
|
||||
const censecDesc = tCensec.find(c => c.censec_id === item.censec_id)?.descricao || "N/A"
|
||||
return (
|
||||
<TableRow key={item.censec_tipoato_id} className="cursor-pointer">
|
||||
<TableCell className="font-medium">
|
||||
{item.censec_tipoato_id}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<StatusBadge situacao={item.situacao} />
|
||||
</TableCell>
|
||||
<TableCell>{censecDesc}</TableCell>
|
||||
{/*<TableCell>{item.codigo ?? "-"}</TableCell>*/}
|
||||
<TableCell>{item.descricao}</TableCell>
|
||||
<TableCell>{item.tipo_separacao ?? "-"}</TableCell>
|
||||
<TableCell>{item.tipo_revogacao ?? "-"}</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="cursor-pointer"
|
||||
>
|
||||
<EllipsisIcon />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent side="left" align="start">
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onEdit(item, true)}
|
||||
>
|
||||
<PencilIcon className="mr-2 h-4 w-4" />
|
||||
Editar
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onDelete(item, true)}
|
||||
>
|
||||
<Trash2Icon className="mr-2 h-4 w-4" />
|
||||
Remover
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
import API from "@/shared/services/api/Api";
|
||||
import { Methods } from "@/shared/services/api/enums/ApiMethodEnum";
|
||||
import TCensecTipoAtoMockDeDados from "./mockCensecTipoAto";
|
||||
import { withClientErrorHandler } from "@/shared/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
const useMock = true
|
||||
|
||||
async function executeTCensecTipoAtoIndexData() {
|
||||
if (useMock) {
|
||||
console.log(TCensecTipoAtoMockDeDados())
|
||||
return await TCensecTipoAtoMockDeDados();
|
||||
}
|
||||
|
||||
const api = new API();
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/t_censec_tipoato/`
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
export const TCensecTipoAtoIndexData = withClientErrorHandler(executeTCensecTipoAtoIndexData)
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/shared/services/api/Api";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import { Methods } from "@/shared/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/shared/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeTCensecTipoAtoRemoveData(data: TCensecTipoAtoInterface) {
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/t_censec_tipoato/${data.censec_tipoato_id}`
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
export const TCensecTipoAtoRemoveData = withClientErrorHandler(executeTCensecTipoAtoRemoveData)
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import API from "@/shared/services/api/Api";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import { Methods } from "@/shared/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/shared/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeTCensecTipoAtoSaveData(data: TCensecTipoAtoInterface) {
|
||||
|
||||
const isUpdate = Boolean(data.censec_tipoato_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/t_censec_tipoato/${data.censec_tipoato_id || ''}`,
|
||||
body: data
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
export const TCensecTipoAtoSaveData = withClientErrorHandler(executeTCensecTipoAtoSaveData)
|
||||
|
|
@ -1,251 +0,0 @@
|
|||
export default async function TCensecTipoAtoMockDeDados() {
|
||||
return Promise.resolve({
|
||||
status: 200,
|
||||
message: 'Dados localizados',
|
||||
data: [
|
||||
{
|
||||
censec_tipoato_id: 1,
|
||||
censec_id: 2,
|
||||
codigo: 1,
|
||||
descricao: "Escritura",
|
||||
situacao: "I",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 2,
|
||||
censec_id: 1,
|
||||
codigo: 2,
|
||||
descricao: "Procuração",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 3,
|
||||
censec_id: 1,
|
||||
codigo: 3,
|
||||
descricao: "Procuração para Fins Previdenciários",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 4,
|
||||
censec_id: 1,
|
||||
codigo: 5,
|
||||
descricao: "Renúncia de Procuração",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 5,
|
||||
censec_id: 1,
|
||||
codigo: 6,
|
||||
descricao: "Revogação de Procuração",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 6,
|
||||
censec_id: 1,
|
||||
codigo: 7,
|
||||
descricao: "Substabelecimento",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 7,
|
||||
censec_id: 1,
|
||||
codigo: 8,
|
||||
descricao: "Ata Notarial",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 8,
|
||||
censec_id: 2,
|
||||
codigo: 1,
|
||||
descricao: "Separação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "S",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 9,
|
||||
censec_id: 2,
|
||||
codigo: 2,
|
||||
descricao: "Reconciliação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 10,
|
||||
censec_id: 2,
|
||||
codigo: 3,
|
||||
descricao: "Conversão de Separação em Divórcio",
|
||||
situacao: "A",
|
||||
tipo_separacao: "S",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 11,
|
||||
censec_id: 2,
|
||||
codigo: 4,
|
||||
descricao: "Divórcio Direto",
|
||||
situacao: "A",
|
||||
tipo_separacao: "S",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 12,
|
||||
censec_id: 2,
|
||||
codigo: 5,
|
||||
descricao: "Inventário",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 13,
|
||||
censec_id: 2,
|
||||
codigo: 6,
|
||||
descricao: "Sobrepartilha",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 14,
|
||||
censec_id: 2,
|
||||
codigo: 7,
|
||||
descricao: "Retificação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 15,
|
||||
censec_id: 3,
|
||||
codigo: 1,
|
||||
descricao: "Aditamento",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 16,
|
||||
censec_id: 3,
|
||||
codigo: 2,
|
||||
descricao: "Cerrado",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 17,
|
||||
censec_id: 3,
|
||||
codigo: 3,
|
||||
descricao: "Revogação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "S"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 18,
|
||||
censec_id: 3,
|
||||
codigo: 4,
|
||||
descricao: "Testamento",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 19,
|
||||
censec_id: 3,
|
||||
codigo: 5,
|
||||
descricao: "Testamento com Revogação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 20,
|
||||
censec_id: 3,
|
||||
codigo: 6,
|
||||
descricao: "Testamento sem Conteúdo Patrimonial",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 21,
|
||||
censec_id: 9,
|
||||
codigo: null,
|
||||
descricao: "Atos Diversos",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 204,
|
||||
censec_id: 1,
|
||||
codigo: 75,
|
||||
descricao: "Conciliação",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 208,
|
||||
censec_id: 1,
|
||||
codigo: 76,
|
||||
descricao: "Mediação",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 209,
|
||||
censec_id: 1,
|
||||
codigo: 8,
|
||||
descricao: "Compra e Venda",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 210,
|
||||
censec_id: 1,
|
||||
codigo: 1,
|
||||
descricao: "Escritura",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 211,
|
||||
censec_id: 2,
|
||||
codigo: 8,
|
||||
descricao: "Nomeação de Inventariante",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 212,
|
||||
censec_id: 2,
|
||||
codigo: 9,
|
||||
descricao: "Partilha",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { MinutaMockDeDadosPorId } from './mockMinuta';
|
||||
|
||||
const useMock = true;
|
||||
|
||||
export default async function TMinutaIndex(t_minuta_id: number) {
|
||||
if (useMock) {
|
||||
console.log(await MinutaMockDeDadosPorId(t_minuta_id)); // Retorna o dado específico do mock
|
||||
return await MinutaMockDeDadosPorId(t_minuta_id); // Retorna o dado específico do mock
|
||||
}
|
||||
|
||||
const api = new API();
|
||||
try {
|
||||
const dados = await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/t_minuta/${t_minuta_id}`,
|
||||
});
|
||||
return dados;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import MinutaMockDeDados from './mockMinuta';
|
||||
|
||||
const useMock = true;
|
||||
|
||||
export default async function TMinutaIndexData() {
|
||||
if (useMock) {
|
||||
return await MinutaMockDeDados(); // Retorna todos os dados mockados
|
||||
}
|
||||
|
||||
const api = new API();
|
||||
try {
|
||||
const dados = await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/t_minuta/`,
|
||||
});
|
||||
return dados;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
import { useState } from 'react';
|
||||
import { GTBTipoLogradouroInterface } from '../../_interfaces/GTBTipoLogradouroInterface';
|
||||
import { GTBTipoLogradouroIndexService } from '../../_services/g_tb_tipologradouro/GTBTipoLogradouroIndexService';
|
||||
|
||||
export const useGTBTipoLogradouroReadHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
const [gTBTipoLogradouro, setGTBTipoLogradouro] = useState<GTBTipoLogradouroInterface[]>([]);
|
||||
|
||||
const fetchGTBTipoLogradouro = async () => {
|
||||
try {
|
||||
const response = await GTBTipoLogradouroIndexService();
|
||||
|
||||
setGTBTipoLogradouro(response.data);
|
||||
|
||||
setResponse(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
return { gTBTipoLogradouro, fetchGTBTipoLogradouro };
|
||||
};
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
import { useResponse } from "@/shared/components/response/ResponseContext"
|
||||
import { useState } from "react";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import { TCensecTipoAtoIndexService } from "../../_services/t_censec_tipoato/TCensecTipoAtoIndexService";
|
||||
|
||||
export const useTCensecTipoAtoReadHook = () => {
|
||||
|
||||
const { setResponse } = useResponse();
|
||||
const [tCensecTipoAto, setTCensecTipoAto] = useState<TCensecTipoAtoInterface[]>([]);
|
||||
|
||||
const fetchTCensecTipoAto = async () => {
|
||||
|
||||
try {
|
||||
const response = await TCensecTipoAtoIndexService();
|
||||
|
||||
setTCensecTipoAto(response.data);
|
||||
|
||||
setResponse(response);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return { tCensecTipoAto, fetchTCensecTipoAto }
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import { useResponse } from "@/shared/components/response/ResponseContext"
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import { TCensecTipoAtoRemoveService } from "../../_services/t_censec_tipoato/TCensecTipoAtoRemoveService";
|
||||
|
||||
export const useTCensecTipoAtoRemoveHook = () => {
|
||||
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const removeTCensecTipoAto = async (data: TCensecTipoAtoInterface) => {
|
||||
|
||||
const response = await TCensecTipoAtoRemoveService(data);
|
||||
|
||||
setResponse(response);
|
||||
|
||||
}
|
||||
|
||||
return { removeTCensecTipoAto }
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
import { useResponse } from "@/shared/components/response/ResponseContext"
|
||||
import { useState } from "react";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import { TCensecTipoAtoSaveService } from "../../_services/t_censec_tipoato/TCensecTipoAtoSaveService";
|
||||
|
||||
export const useTCensecTipoAtoSaveHook = () => {
|
||||
|
||||
const { setResponse } = useResponse();
|
||||
const [tCensecTipoAto, setTCensecTipoAto] = useState<TCensecTipoAtoInterface | null>(null);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const saveTCensecTipoAto = async (data: TCensecTipoAtoInterface) => {
|
||||
|
||||
const response = await TCensecTipoAtoSaveService(data);
|
||||
|
||||
setTCensecTipoAto(response.data);
|
||||
|
||||
setResponse(response);
|
||||
|
||||
setIsOpen(false);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
return { tCensecTipoAto, saveTCensecTipoAto }
|
||||
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
import { useState } from 'react';
|
||||
import { TCensecNaturezaLitigioInterface } from '../../_interfaces/TCensecNaturezaLitigioInterface';
|
||||
import { TCensecNaturezaLitigioIndexService } from '../../_services/t_censecnaturezalitigio/TCensecNaturezaLitigioIndexService';
|
||||
|
||||
export const useTCensecNaturezaLitigioReadHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
const [tCensecNaturezaLitigio, setTCensecNaturezaLitigio] = useState<
|
||||
TCensecNaturezaLitigioInterface[]
|
||||
>([]);
|
||||
|
||||
const fetchTCensecNaturezaLitigio = async () => {
|
||||
try {
|
||||
const response = await TCensecNaturezaLitigioIndexService();
|
||||
|
||||
setTCensecNaturezaLitigio(response.data);
|
||||
|
||||
console.log(response);
|
||||
|
||||
setResponse(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
return { tCensecNaturezaLitigio, fetchTCensecNaturezaLitigio };
|
||||
};
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
import { useState } from 'react';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
import TMinutaIndexService from '../../_services/t_minuta/TMinutaIndexService';
|
||||
|
||||
export const useTMinutaReadHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
const [tMinuta, setTMinuta] = useState<TMinutaInterface>();
|
||||
|
||||
const fetchTMinuta = async (tMinuta: TMinutaInterface) => {
|
||||
try {
|
||||
const response = await TMinutaIndexService(tMinuta.t_minuta_id);
|
||||
console.log('read hook', response.data);
|
||||
|
||||
setTMinuta(response.data);
|
||||
|
||||
setResponse(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
return { tMinuta, fetchTMinuta };
|
||||
};
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import ITTTBReconhecimentoTipo from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
import { useState } from 'react';
|
||||
import TTBReconhecimentoTipoIndexData from '../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndexData';
|
||||
|
||||
export const useTTBReconhecimentoTipoReadHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const [tTBReconhecimentosTipos, setReconhecimenntosTipos] = useState<ITTTBReconhecimentoTipo[]>(
|
||||
[],
|
||||
);
|
||||
|
||||
const fetchTTBReconhecimentosTipos = async () => {
|
||||
const response = await TTBReconhecimentoTipoIndexData();
|
||||
|
||||
setReconhecimenntosTipos(response.data);
|
||||
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
return { tTBReconhecimentosTipos, fetchTTBReconhecimentosTipos };
|
||||
};
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import { z } from "zod";
|
||||
import { SituacoesEnum } from "@/enums/SituacoesEnum";
|
||||
|
||||
export const TCensecTipoAtoSchema = z.object({
|
||||
censec_tipoato_id: z.number().int(),
|
||||
censec_id: z.number("Precisa referir a qual Central do Censec pertence").int(),
|
||||
codigo: z.number().int().nullable(),
|
||||
descricao: z.string().min(1, "Campo descrição deve ser preenchido"),
|
||||
situacao: z.enum(SituacoesEnum, { message: "Tipo inválido" }),
|
||||
tipo_separacao: z.enum(["S", "N"]).nullable(),
|
||||
tipo_revogacao: z.enum(["S", "N"]).nullable(),
|
||||
});
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import { z } from 'zod';
|
||||
import { situacaoEnum } from '../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
|
||||
export const TTBReconhecimentoTipoSchema = z.object({
|
||||
tb_reconhecimentotipo_id: z.number().optional(),
|
||||
descricao: z.string().min(1, 'Campo descrição deve ser preenchido'),
|
||||
situacao: z.nativeEnum(situacaoEnum, { message: 'Tipo inválido' }),
|
||||
});
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import GTBProfissaoRemoveData from '../../_data/GTBProfissao/GTBProfissaoRemoveData';
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
|
||||
export default async function GTBProfissaoRemoveService(data: GTBProfissaoInterface) {
|
||||
const response = await GTBProfissaoRemoveData(data);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import GTBProfissaoSaveData from '../../_data/GTBProfissao/GTBProfissaoSaveData';
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
|
||||
export default async function GTProfissaoSaveService(data: GTBProfissaoInterface) {
|
||||
const response = await GTBProfissaoSaveData(data);
|
||||
|
||||
console.log('GTBRegimeComunhaoSaveData', response);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import GTBRegimeBensRemoveData from '../../_data/GTBRegimeBens/GTBRegimeBensRemoveData';
|
||||
import GTBRegimeBensInterface from '../../_interfaces/GTBRegimeBensInterface';
|
||||
|
||||
export default async function GTBRegimeBensRemoveService(data: GTBRegimeBensInterface) {
|
||||
const response = await GTBRegimeBensRemoveData(data);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import { withClientErrorHandler } from "@/shared/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import { TCensecTipoAtoIndexData } from "../../_data/TCensecTipoAto/GMedidaTipoIndexData";
|
||||
|
||||
async function executeTCensecTipoAtoIndexService() {
|
||||
|
||||
const response = await TCensecTipoAtoIndexData();
|
||||
return response;
|
||||
}
|
||||
|
||||
export const TCensecTipoAtoIndexService = withClientErrorHandler(executeTCensecTipoAtoIndexService)
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import { withClientErrorHandler } from "@/shared/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import { TCensecTipoAtoRemoveData } from "../../_data/TCensecTipoAto/GMedidaTipoRemoveData";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
|
||||
async function executeTCensecTipoAtoRemoveService(data: TCensecTipoAtoInterface) {
|
||||
|
||||
const response = await TCensecTipoAtoRemoveData(data);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
export const TCensecTipoAtoRemoveService = withClientErrorHandler(executeTCensecTipoAtoRemoveService)
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import { withClientErrorHandler } from "@/shared/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import { TCensecTipoAtoSaveData } from "../../_data/TCensecTipoAto/GMedidaTipoSaveData";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
|
||||
async function executeTCensecTipoAtoSaveService(data: TCensecTipoAtoInterface) {
|
||||
|
||||
const response = await TCensecTipoAtoSaveData(data);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
export const TCensecTipoAtoSaveService = withClientErrorHandler(executeTCensecTipoAtoSaveService)
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import TMinutaIndexData from '../../_data/TMinuta/TMinutaIndexData';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
|
||||
export default async function TMinutaIndex() {
|
||||
try {
|
||||
const response = await TMinutaIndexData();
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import TMinutaIndex from '../../_data/TMinuta/TMinutaIndex';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
|
||||
export default async function TMinutaIndexService(t_minuta_id: number) {
|
||||
if (t_minuta_id <= 0) {
|
||||
return {
|
||||
code: 400,
|
||||
message: 'Usuário informado inválido',
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await TMinutaIndex(t_minuta_id);
|
||||
console.log('service', response);
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import TMinutaRemoveData from '../../_data/TMinuta/TMinutaRemoveData';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
|
||||
export default async function TMinutaRemoveService(data: TMinutaInterface) {
|
||||
const response = await TMinutaRemoveData(data);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import TMinutaSaveData from '../../_data/TMinuta/TMinutaSaveData';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
|
||||
export default async function TMinutaSaveService(data: TMinutaInterface) {
|
||||
const response = await TMinutaSaveData(data);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
import { FileText, Heart, Briefcase, Scale, Link as LinkIcon, MapPin } from 'lucide-react';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function CadastrosPage() {
|
||||
const items = [
|
||||
{
|
||||
title: 'Documentos',
|
||||
description: 'Gerencie os tipos de documentos aceitos e suas configurações no sistema.',
|
||||
icon: FileText,
|
||||
},
|
||||
{
|
||||
title: 'Estado Civil',
|
||||
description: 'Cadastre e mantenha os diferentes estados civis utilizados nos registros.',
|
||||
icon: Heart,
|
||||
},
|
||||
{
|
||||
title: 'Profissão',
|
||||
description: 'Gerencie a lista de profissões para utilização em cadastros e registros.',
|
||||
icon: Briefcase,
|
||||
},
|
||||
{
|
||||
title: 'Regime de Comunhão',
|
||||
description: 'Defina os regimes de comunhão aplicáveis em matrimônios e registros civis.',
|
||||
icon: Scale,
|
||||
},
|
||||
{
|
||||
title: 'Vínculo de Sinal Público',
|
||||
description:
|
||||
'Controle e cadastre vínculos relacionados a sinais públicos para autenticações.',
|
||||
icon: LinkIcon,
|
||||
},
|
||||
{
|
||||
title: 'Municípios',
|
||||
description: 'Gerencie a base de municípios para utilização em endereços e cadastros.',
|
||||
icon: MapPin,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="mb-1 text-4xl font-semibold">Complementos de Cadastro pessoal</h1>
|
||||
<p className="text-muted-foreground text-base">
|
||||
Gerencie os cadastros relacionados a regimes, como estado civil, regime de comunhão e
|
||||
outras informações complementares necessárias para o registro de pessoas.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-5 gap-3">
|
||||
{items.map((item, key) => (
|
||||
<Link key={key} href={'/'}>
|
||||
<Card className="hover:bg-muted cursor-pointer transition-colors">
|
||||
<CardContent>
|
||||
<span className="mb-2 inline-flex shrink-0 rounded-md border border-blue-300 bg-blue-100 p-2 dark:border-blue-300/10 dark:bg-blue-400/10">
|
||||
<item.icon className="size-6 stroke-blue-700 dark:stroke-blue-500" />
|
||||
</span>
|
||||
<h3 className="mt-3 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">
|
||||
{item.title}
|
||||
</h3>
|
||||
<p className="mt-1 text-sm text-gray-500 dark:text-gray-400">{item.description}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { Card, CardAction, CardContent, CardDescription, CardTitle } from '@/components/ui/card';
|
||||
import {
|
||||
BabyIcon,
|
||||
CrossIcon,
|
||||
FileCheckIcon,
|
||||
FileTextIcon,
|
||||
GavelIcon,
|
||||
GlobeIcon,
|
||||
HeartIcon,
|
||||
PenIcon,
|
||||
ScrollIcon,
|
||||
UsersIcon,
|
||||
} from 'lucide-react';
|
||||
|
||||
const services = [
|
||||
{
|
||||
title: 'Registro de Nascimento',
|
||||
description:
|
||||
'Emissão e registro de certidões de nascimento, garantindo a cidadania e identidade legal do recém-nascido.',
|
||||
icon: BabyIcon,
|
||||
},
|
||||
{
|
||||
title: 'Registro de Casamento',
|
||||
description: 'Processo completo para habilitação, registro e emissão da certidão de casamento.',
|
||||
icon: HeartIcon,
|
||||
},
|
||||
{
|
||||
title: 'Registro de Óbito',
|
||||
description:
|
||||
'Lavratura do registro de óbito e emissão da certidão correspondente para fins legais.',
|
||||
icon: CrossIcon,
|
||||
},
|
||||
{
|
||||
title: 'Reconhecimento de Firma',
|
||||
description: 'Autenticação da assinatura de documentos, garantindo sua validade jurídica.',
|
||||
icon: PenIcon,
|
||||
},
|
||||
{
|
||||
title: 'Autenticação de Documentos',
|
||||
description: 'Confirmação de que cópias estão de acordo com o documento original apresentado.',
|
||||
icon: FileCheckIcon,
|
||||
},
|
||||
{
|
||||
title: 'Procurações',
|
||||
description:
|
||||
'Elaboração e registro de procurações públicas para representação legal de pessoas físicas ou jurídicas.',
|
||||
icon: ScrollIcon,
|
||||
},
|
||||
{
|
||||
title: 'Testamentos',
|
||||
description: 'Lavratura e registro de testamentos públicos com segurança jurídica.',
|
||||
icon: GavelIcon,
|
||||
},
|
||||
{
|
||||
title: 'Divórcio Extrajudicial',
|
||||
description:
|
||||
'Formalização do divórcio por via administrativa, de forma rápida e sem processo judicial.',
|
||||
icon: UsersIcon,
|
||||
},
|
||||
{
|
||||
title: 'Apostilamento de Documentos',
|
||||
description:
|
||||
'Apostilamento conforme a Convenção da Haia para validade internacional de documentos.',
|
||||
icon: GlobeIcon,
|
||||
},
|
||||
{
|
||||
title: 'Certidões e Segunda Via',
|
||||
description: 'Emissão de segundas vias e certidões de nascimento, casamento e óbito.',
|
||||
icon: FileTextIcon,
|
||||
},
|
||||
];
|
||||
|
||||
export default function ServicosPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="bg-primary/10 border-primary/20 w-full rounded-xl border p-6">
|
||||
<h2 className="text-primary text-2xl font-semibold">Bem-vindo(a)!</h2>
|
||||
<p className="mt-2 text-base text-gray-700">
|
||||
Olá, <span className="text-primary font-bold">Keven</span>! É um prazer ter você conosco.
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-3 grid grid-cols-4 space-y-2 space-x-2">
|
||||
{services.map((item: any, index) => (
|
||||
<Card className="cursor-pointer" key={index}>
|
||||
<CardContent>
|
||||
<div className="bg-primary flex h-12 w-12 items-center justify-center rounded-2xl">
|
||||
<item.icon className="h-6 w-6 text-white" />
|
||||
</div>
|
||||
|
||||
<CardTitle className="mt-3">{item.title}</CardTitle>
|
||||
<CardDescription className="mt-3">{item.description}</CardDescription>
|
||||
</CardContent>
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -2,8 +2,8 @@ import type { Metadata } from 'next';
|
|||
import { Geist, Geist_Mono } from 'next/font/google';
|
||||
import '../globals.css';
|
||||
|
||||
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
|
||||
import { AppSidebar } from '@/components/app-sidebar';
|
||||
import { ThemeProvider } from '@/components/theme-provider';
|
||||
import {
|
||||
Breadcrumb,
|
||||
BreadcrumbItem,
|
||||
|
|
@ -15,7 +15,9 @@ import {
|
|||
import { Separator } from '@/components/ui/separator';
|
||||
import { SidebarInset, SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
|
||||
import { Toaster } from '@/components/ui/sonner';
|
||||
|
||||
import Response from '../../shared/components/response/response';
|
||||
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: '--font-geist-sans',
|
||||
|
|
@ -35,50 +37,46 @@ export const metadata: Metadata = {
|
|||
},
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
|
||||
<SidebarProvider>
|
||||
<AppSidebar />
|
||||
<SidebarInset>
|
||||
<header className="mb-4 flex h-16 shrink-0 items-center gap-2 border-b-1 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12">
|
||||
<div className="flex items-center gap-2 px-4">
|
||||
<SidebarTrigger className="-ml-1" />
|
||||
<Separator
|
||||
orientation="vertical"
|
||||
className="mr-2 data-[orientation=vertical]:h-4"
|
||||
/>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem className="hidden md:block">
|
||||
<BreadcrumbLink href="#">
|
||||
Building Your Application
|
||||
</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator className="hidden md:block" />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>
|
||||
Data Fetching
|
||||
</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</BreadcrumbList>
|
||||
</Breadcrumb>
|
||||
</div>
|
||||
</header>
|
||||
<ResponseProvider>
|
||||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0">
|
||||
{children}
|
||||
<Toaster richColors position="top-center" />
|
||||
<Response />
|
||||
</div>
|
||||
</ResponseProvider>
|
||||
</SidebarInset>
|
||||
</SidebarProvider>
|
||||
<ThemeProvider>
|
||||
<SidebarProvider>
|
||||
<AppSidebar />
|
||||
|
||||
<SidebarInset>
|
||||
<header className="mb-4 flex h-16 shrink-0 items-center gap-2 border-b-1 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12">
|
||||
<div className="flex items-center gap-2 px-4">
|
||||
<SidebarTrigger className="-ml-1" />
|
||||
<Separator
|
||||
orientation="vertical"
|
||||
className="mr-2 data-[orientation=vertical]:h-4"
|
||||
/>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem className="hidden md:block">
|
||||
<BreadcrumbLink href="#">Building Your Application</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator className="hidden md:block" />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>Data Fetching</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</BreadcrumbList>
|
||||
</Breadcrumb>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<ResponseProvider>
|
||||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0">
|
||||
{children}
|
||||
<Toaster richColors position="top-center" />
|
||||
<Response />
|
||||
</div>
|
||||
</ResponseProvider>
|
||||
</SidebarInset>
|
||||
</SidebarProvider>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
|
|||
51
src/app/(protected)/page.tsx
Normal file
51
src/app/(protected)/page.tsx
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||
|
||||
export default function Page() {
|
||||
const { userAuthenticated } = useGUsuarioGetJWTHook();
|
||||
|
||||
// Inicializa time como null para renderizar só no cliente
|
||||
const [time, setTime] = useState<Date | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setTime(new Date()); // define data inicial no cliente
|
||||
const interval = setInterval(() => setTime(new Date()), 1000);
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
// Se ainda não temos a hora, renderiza nada para evitar mismatch
|
||||
if (!time || !userAuthenticated?.data) return null;
|
||||
|
||||
const hours = time.getHours();
|
||||
const greeting = hours < 12 ? 'Bom dia' : hours < 18 ? 'Boa tarde' : 'Boa noite';
|
||||
|
||||
const formattedDate = time.toLocaleDateString('pt-BR', {
|
||||
weekday: 'long',
|
||||
day: '2-digit',
|
||||
month: 'long',
|
||||
});
|
||||
const formattedTime = time.toLocaleTimeString('pt-BR');
|
||||
|
||||
return (
|
||||
<main className="fixed inset-0 flex flex-col items-center justify-center overflow-hidden text-gray-800 select-none">
|
||||
<section className="max-w-md px-4 text-center">
|
||||
<h1 className="mb-2 text-4xl font-bold">
|
||||
{greeting}, <span className="text-blue-600">{userAuthenticated.data.nome}</span> 👋
|
||||
</h1>
|
||||
|
||||
<p className="mb-6 text-sm text-gray-600">
|
||||
Hoje é <strong>{formattedDate}</strong>, {formattedTime}
|
||||
</p>
|
||||
|
||||
<div className="rounded-2xl p-6">
|
||||
<p className="leading-relaxed text-gray-700">
|
||||
Que bom ter você de volta! 🎉 Aproveite o seu dia e continue alcançando seus objetivos.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
5
src/app/(protected)/servicos/atos/ato/page.tsx
Normal file
5
src/app/(protected)/servicos/atos/ato/page.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import TAtoForm from '@/packages/servicos/components/TAto/TAtoForm';
|
||||
|
||||
export default function TAtoFormPage() {
|
||||
return <TAtoForm />;
|
||||
}
|
||||
5
src/app/(protected)/servicos/atos/page.tsx
Normal file
5
src/app/(protected)/servicos/atos/page.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import TAtoIndex from '@/packages/servicos/components/TAto/TAtoIndex';
|
||||
|
||||
export default function TServicoAToPag() {
|
||||
return <TAtoIndex />;
|
||||
}
|
||||
5
src/app/(protected)/servicos/dashboard/page.tsx
Normal file
5
src/app/(protected)/servicos/dashboard/page.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import TServicoPedidoDashboard from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDashboard';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoDashboard />;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import TServicoPedidoDetails from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDetails';
|
||||
|
||||
export default function TServicoPedidoDetailsPage() {
|
||||
const params = useParams();
|
||||
|
||||
return <TServicoPedidoDetails servico_pedido_id={Number(params.servicoPedidoId)} />;
|
||||
}
|
||||
5
src/app/(protected)/servicos/pedidos/page.tsx
Normal file
5
src/app/(protected)/servicos/pedidos/page.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import TServicoPedidoIndex from '@/packages/servicos/components/TServicoPedido/TServicoPedidoIndex';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
const params = useParams();
|
||||
|
||||
return <TServicoPedidoForm servico_pedido_id={Number(params.servicoPedidoId)} />;
|
||||
}
|
||||
5
src/app/(protected)/servicos/pedidos/pedido/page.tsx
Normal file
5
src/app/(protected)/servicos/pedidos/pedido/page.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoForm />;
|
||||
}
|
||||
|
|
@ -1,124 +1,111 @@
|
|||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
AlertDialogAction,
|
||||
} from '@/components/ui/alert-dialog';
|
||||
|
||||
import {
|
||||
InputOTP,
|
||||
InputOTPGroup,
|
||||
InputOTPSlot,
|
||||
} from '@/components/ui/input-otp';
|
||||
AlertDialog,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
AlertDialogAction,
|
||||
} from '@/components/ui/alert-dialog';
|
||||
import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';
|
||||
|
||||
interface ConfirmExclusionProps {
|
||||
isOpen: boolean;
|
||||
title: string;
|
||||
description?: string;
|
||||
expectedCode: string;
|
||||
confirmText?: string;
|
||||
cancelText?: string;
|
||||
onConfirm: () => void;
|
||||
onCancel: () => void;
|
||||
onResendCode: () => void; // Função para reenviar o código
|
||||
isOpen: boolean;
|
||||
title: string;
|
||||
description?: string;
|
||||
expectedCode: string;
|
||||
confirmText?: string;
|
||||
cancelText?: string;
|
||||
onConfirm: () => void;
|
||||
onCancel: () => void;
|
||||
onResendCode: () => void; // Função para reenviar o código
|
||||
}
|
||||
|
||||
export default function ConfirmExclusion({
|
||||
isOpen,
|
||||
title,
|
||||
description,
|
||||
expectedCode,
|
||||
confirmText = 'Continuar',
|
||||
cancelText = 'Cancelar',
|
||||
onConfirm,
|
||||
onCancel,
|
||||
onResendCode, // A função para reenvio do código
|
||||
isOpen,
|
||||
title,
|
||||
description,
|
||||
expectedCode,
|
||||
confirmText = 'Continuar',
|
||||
cancelText = 'Cancelar',
|
||||
onConfirm,
|
||||
onCancel,
|
||||
onResendCode, // A função para reenvio do código
|
||||
}: ConfirmExclusionProps) {
|
||||
const [code, setCode] = useState('');
|
||||
const [isValid, setIsValid] = useState(false);
|
||||
const [isResending, setIsResending] = useState(false); // Novo estado para controle de envio do código
|
||||
const [code, setCode] = useState('');
|
||||
const [isValid, setIsValid] = useState(false);
|
||||
const [isResending, setIsResending] = useState(false); // Novo estado para controle de envio do código
|
||||
|
||||
const handleChange = (value: string) => {
|
||||
setCode(value);
|
||||
setIsValid(value === expectedCode);
|
||||
};
|
||||
const handleChange = (value: string) => {
|
||||
setCode(value);
|
||||
setIsValid(value === expectedCode);
|
||||
};
|
||||
|
||||
const handleResendCode = async () => {
|
||||
setIsResending(true);
|
||||
try {
|
||||
await onResendCode(); // Chamando a função de reenvio
|
||||
} catch (error) {
|
||||
console.error("Erro ao reenviar código", error);
|
||||
} finally {
|
||||
setIsResending(false); // Resetando o estado de envio
|
||||
}
|
||||
};
|
||||
const handleResendCode = async () => {
|
||||
setIsResending(true);
|
||||
try {
|
||||
await onResendCode(); // Chamando a função de reenvio
|
||||
} catch (error) {
|
||||
console.error('Erro ao reenviar código', error);
|
||||
} finally {
|
||||
setIsResending(false); // Resetando o estado de envio
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<AlertDialog open={isOpen} onOpenChange={(open) => !open && onCancel()}>
|
||||
<AlertDialogContent className="max-w-lg mx-auto p-6">
|
||||
<AlertDialogHeader className="text-center">
|
||||
<AlertDialogTitle className="text-xl font-semibold text-center">{title}</AlertDialogTitle>
|
||||
{description && (
|
||||
<AlertDialogDescription className="mt-2 text-sm text-muted-foreground text-center">
|
||||
{description}
|
||||
</AlertDialogDescription>
|
||||
)}
|
||||
</AlertDialogHeader>
|
||||
return (
|
||||
<AlertDialog open={isOpen} onOpenChange={(open) => !open && onCancel()}>
|
||||
<AlertDialogContent className="mx-auto max-w-lg p-6">
|
||||
<AlertDialogHeader className="text-center">
|
||||
<AlertDialogTitle className="text-center text-xl font-semibold">{title}</AlertDialogTitle>
|
||||
{description && (
|
||||
<AlertDialogDescription className="text-muted-foreground mt-2 text-center text-sm">
|
||||
{description}
|
||||
</AlertDialogDescription>
|
||||
)}
|
||||
</AlertDialogHeader>
|
||||
|
||||
<div className="py-4 text-sm text-muted-foreground space-y-4">
|
||||
<div className="flex justify-center">
|
||||
<InputOTP
|
||||
maxLength={expectedCode.length}
|
||||
value={code}
|
||||
onChange={handleChange}
|
||||
>
|
||||
<InputOTPGroup className="flex gap-4">
|
||||
{expectedCode.split('').map((_, index) => (
|
||||
<InputOTPSlot
|
||||
key={index}
|
||||
index={index}
|
||||
className="w-12 h-12 text-center text-lg border-2 border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
))}
|
||||
</InputOTPGroup>
|
||||
</InputOTP>
|
||||
</div>
|
||||
<div className="text-muted-foreground space-y-4 py-4 text-sm">
|
||||
<div className="flex justify-center">
|
||||
<InputOTP maxLength={expectedCode.length} value={code} onChange={handleChange}>
|
||||
<InputOTPGroup className="flex gap-4">
|
||||
{expectedCode.split('').map((_, index) => (
|
||||
<InputOTPSlot
|
||||
key={index}
|
||||
index={index}
|
||||
className="h-12 w-12 rounded-lg border-2 border-gray-300 text-center text-lg focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
))}
|
||||
</InputOTPGroup>
|
||||
</InputOTP>
|
||||
</div>
|
||||
|
||||
{/* Botão "Reenviar Código" */}
|
||||
<div className="flex justify-center items-center text-center gap-2 mt-4">
|
||||
<AlertDialogDescription>
|
||||
Não recebeu o código?
|
||||
</AlertDialogDescription>
|
||||
<button
|
||||
onClick={handleResendCode}
|
||||
className={`text-blue-500 font-semibold cursor-pointer ${isResending ? 'cursor-not-allowed text-gray-400' : 'hover:text-blue-600'}`}
|
||||
disabled={isResending} // Desabilita o botão enquanto o código está sendo reenviado
|
||||
>
|
||||
{isResending ? 'Enviando...' : 'Reenviar Código'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/* Botão "Reenviar Código" */}
|
||||
<div className="mt-4 flex items-center justify-center gap-2 text-center">
|
||||
<AlertDialogDescription>Não recebeu o código?</AlertDialogDescription>
|
||||
<button
|
||||
onClick={handleResendCode}
|
||||
className={`cursor-pointer font-semibold text-blue-500 ${isResending ? 'cursor-not-allowed text-gray-400' : 'hover:text-blue-600'}`}
|
||||
disabled={isResending} // Desabilita o botão enquanto o código está sendo reenviado
|
||||
>
|
||||
{isResending ? 'Enviando...' : 'Reenviar Código'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel onClick={onCancel} className="text-gray-600 hover:text-gray-800">
|
||||
{cancelText}
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={onConfirm}
|
||||
disabled={!isValid}
|
||||
>
|
||||
{confirmText}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
);
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel onClick={onCancel} className="text-gray-600 hover:text-gray-800">
|
||||
{cancelText}
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction onClick={onConfirm} disabled={!isValid}>
|
||||
{confirmText}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useCallback, useState } from "react";
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
interface UseConfirmExclusionOptions {
|
||||
onConfirm?: () => void;
|
||||
|
|
@ -6,15 +6,19 @@ interface UseConfirmExclusionOptions {
|
|||
expectedCode: string; // código que o usuário precisa digitar
|
||||
}
|
||||
|
||||
export function useConfirmExclusion({ onConfirm, onCancel, expectedCode }: UseConfirmExclusionOptions) {
|
||||
export function useConfirmExclusion({
|
||||
onConfirm,
|
||||
onCancel,
|
||||
expectedCode,
|
||||
}: UseConfirmExclusionOptions) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [code, setCode] = useState("");
|
||||
const [code, setCode] = useState('');
|
||||
const [isValid, setIsValid] = useState(false);
|
||||
|
||||
const openDialog = useCallback(() => setIsOpen(true), []);
|
||||
const closeDialog = useCallback(() => {
|
||||
setIsOpen(false);
|
||||
setCode("");
|
||||
setCode(''); // limpa o código quando fecha
|
||||
setIsValid(false);
|
||||
}, []);
|
||||
|
||||
|
|
@ -35,7 +39,7 @@ export function useConfirmExclusion({ onConfirm, onCancel, expectedCode }: UseCo
|
|||
setCode(value);
|
||||
setIsValid(value === expectedCode);
|
||||
},
|
||||
[expectedCode]
|
||||
[expectedCode],
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -3,60 +3,194 @@
|
|||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
:root {
|
||||
--background: oklch(0.9911 0 0);
|
||||
--foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--popover: oklch(0.9881 0 0);
|
||||
--popover-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--primary: oklch(0.721 0.1873 47.564);
|
||||
--primary-foreground: oklch(1 0 0);
|
||||
--secondary: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary-foreground: oklch(1 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.9551 0 0);
|
||||
--accent-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
--chart-1: oklch(0.81 0.1 252);
|
||||
--chart-2: oklch(0.62 0.19 260);
|
||||
--chart-3: oklch(0.55 0.22 263);
|
||||
--chart-4: oklch(0.49 0.22 264);
|
||||
--chart-5: oklch(0.42 0.18 266);
|
||||
--sidebar: oklch(1 0 0);
|
||||
--sidebar-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--sidebar-primary: oklch(0.2364 0.0083 240.2365);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--radius: 0.625rem;
|
||||
--shadow-x: 0;
|
||||
--shadow-y: 1px;
|
||||
--shadow-blur: 3px;
|
||||
--shadow-spread: 0px;
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-color: oklch(0 0 0);
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
--tracking-normal: 0em;
|
||||
--spacing: 0.25rem;
|
||||
--shadow-offset-x: 0;
|
||||
--shadow-offset-y: 1px;
|
||||
--letter-spacing: 0em;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.1934 0.0062 236.9149);
|
||||
--foreground: oklch(0.9881 0 0);
|
||||
--card: oklch(0.2364 0.0083 240.2365);
|
||||
--card-foreground: oklch(0.9881 0 0);
|
||||
--popover: oklch(0.2988 0.0123 222.4429);
|
||||
--popover-foreground: oklch(0.9881 0 0);
|
||||
--primary: oklch(0.721 0.1873 47.564);
|
||||
--primary-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary-foreground: oklch(1 0 0);
|
||||
--muted: oklch(0.269 0 0);
|
||||
--muted-foreground: oklch(0.708 0 0);
|
||||
--accent: oklch(0.2988 0.0123 222.4429);
|
||||
--accent-foreground: oklch(1 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--destructive-foreground: oklch(0.985 0 0);
|
||||
--border: oklch(0.275 0 0);
|
||||
--input: oklch(0.325 0 0);
|
||||
--ring: oklch(0.556 0 0);
|
||||
--chart-1: oklch(0.81 0.1 252);
|
||||
--chart-2: oklch(0.62 0.19 260);
|
||||
--chart-3: oklch(0.55 0.22 263);
|
||||
--chart-4: oklch(0.49 0.22 264);
|
||||
--chart-5: oklch(0.42 0.18 266);
|
||||
--sidebar: oklch(0.2364 0.0083 240.2365);
|
||||
--sidebar-foreground: oklch(0.9881 0 0);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.269 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(0.275 0 0);
|
||||
--sidebar-ring: oklch(0.439 0 0);
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--radius: 0.625rem;
|
||||
--shadow-x: 0;
|
||||
--shadow-y: 1px;
|
||||
--shadow-blur: 3px;
|
||||
--shadow-spread: 0px;
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-color: oklch(0 0 0);
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
--shadow-offset-x: 0;
|
||||
--shadow-offset-y: 1px;
|
||||
--letter-spacing: 0em;
|
||||
--spacing: 0.25rem;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--font-sans: Inter, sans-serif;
|
||||
--font-mono: JetBrains Mono, monospace;
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-ring: var(--ring);
|
||||
--color-input: var(--input);
|
||||
--color-border: var(--border);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-destructive-foreground: var(--destructive-foreground);
|
||||
--color-border: var(--border);
|
||||
--color-input: var(--input);
|
||||
--color-ring: var(--ring);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
--radius-xl: calc(var(--radius) + 4px);
|
||||
--font-serif: Source Serif 4, serif;
|
||||
--radius: 0.375rem;
|
||||
|
||||
--shadow-2xs: var(--shadow-2xs);
|
||||
--shadow-xs: var(--shadow-xs);
|
||||
--shadow-sm: var(--shadow-sm);
|
||||
--shadow: var(--shadow);
|
||||
--shadow-md: var(--shadow-md);
|
||||
--shadow-lg: var(--shadow-lg);
|
||||
--shadow-xl: var(--shadow-xl);
|
||||
--shadow-2xl: var(--shadow-2xl);
|
||||
--radius: 0.625rem;
|
||||
--tracking-tighter: calc(var(--tracking-normal) - 0.05em);
|
||||
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
|
||||
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
|
||||
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
|
||||
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
|
||||
--tracking-normal: var(--tracking-normal);
|
||||
--shadow-2xl: var(--shadow-2xl);
|
||||
--shadow-xl: var(--shadow-xl);
|
||||
--shadow-lg: var(--shadow-lg);
|
||||
--shadow-md: var(--shadow-md);
|
||||
--shadow: var(--shadow);
|
||||
--shadow-sm: var(--shadow-sm);
|
||||
--shadow-xs: var(--shadow-xs);
|
||||
--shadow-2xs: var(--shadow-2xs);
|
||||
--spacing: var(--spacing);
|
||||
--letter-spacing: var(--letter-spacing);
|
||||
--shadow-offset-y: var(--shadow-offset-y);
|
||||
|
|
@ -65,118 +199,6 @@
|
|||
--shadow-blur: var(--shadow-blur);
|
||||
--shadow-opacity: var(--shadow-opacity);
|
||||
--color-shadow-color: var(--shadow-color);
|
||||
--color-destructive-foreground: var(--destructive-foreground);
|
||||
}
|
||||
|
||||
:root {
|
||||
--radius: 0.375rem;
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.2686 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.2686 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.2686 0 0);
|
||||
--primary: oklch(0.7686 0.1647 70.0804);
|
||||
--primary-foreground: oklch(0 0 0);
|
||||
--secondary: oklch(0.967 0.0029 264.5419);
|
||||
--secondary-foreground: oklch(0.4461 0.0263 256.8018);
|
||||
--muted: oklch(0.9846 0.0017 247.8389);
|
||||
--muted-foreground: oklch(0.551 0.0234 264.3637);
|
||||
--accent: oklch(0.9869 0.0214 95.2774);
|
||||
--accent-foreground: oklch(0.4732 0.1247 46.2007);
|
||||
--destructive: oklch(0.6368 0.2078 25.3313);
|
||||
--border: oklch(0.9276 0.0058 264.5313);
|
||||
--input: oklch(0.9276 0.0058 264.5313);
|
||||
--ring: oklch(0.7686 0.1647 70.0804);
|
||||
--chart-1: oklch(0.7686 0.1647 70.0804);
|
||||
--chart-2: oklch(0.6658 0.1574 58.3183);
|
||||
--chart-3: oklch(0.5553 0.1455 48.9975);
|
||||
--chart-4: oklch(0.4732 0.1247 46.2007);
|
||||
--chart-5: oklch(0.4137 0.1054 45.9038);
|
||||
--sidebar: oklch(0.9846 0.0017 247.8389);
|
||||
--sidebar-foreground: oklch(0.2686 0 0);
|
||||
--sidebar-primary: oklch(0.7686 0.1647 70.0804);
|
||||
--sidebar-primary-foreground: oklch(1 0 0);
|
||||
--sidebar-accent: oklch(0.9869 0.0214 95.2774);
|
||||
--sidebar-accent-foreground: oklch(0.4732 0.1247 46.2007);
|
||||
--sidebar-border: oklch(0.9276 0.0058 264.5313);
|
||||
--sidebar-ring: oklch(0.7686 0.1647 70.0804);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--font-sans: Inter, sans-serif;
|
||||
--font-serif: Source Serif 4, serif;
|
||||
--font-mono: JetBrains Mono, monospace;
|
||||
--shadow-color: hsl(0 0% 0%);
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-blur: 8px;
|
||||
--shadow-spread: -1px;
|
||||
--shadow-offset-x: 0px;
|
||||
--shadow-offset-y: 4px;
|
||||
--letter-spacing: 0em;
|
||||
--spacing: 0.25rem;
|
||||
--shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 8px 10px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
|
||||
--tracking-normal: 0em;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.2046 0 0);
|
||||
--foreground: oklch(0.9219 0 0);
|
||||
--card: oklch(0.2686 0 0);
|
||||
--card-foreground: oklch(0.9219 0 0);
|
||||
--popover: oklch(0.2686 0 0);
|
||||
--popover-foreground: oklch(0.9219 0 0);
|
||||
--primary: oklch(0.7686 0.1647 70.0804);
|
||||
--primary-foreground: oklch(0 0 0);
|
||||
--secondary: oklch(0.2686 0 0);
|
||||
--secondary-foreground: oklch(0.9219 0 0);
|
||||
--muted: oklch(0.2686 0 0);
|
||||
--muted-foreground: oklch(0.7155 0 0);
|
||||
--accent: oklch(0.4732 0.1247 46.2007);
|
||||
--accent-foreground: oklch(0.9243 0.1151 95.7459);
|
||||
--destructive: oklch(0.6368 0.2078 25.3313);
|
||||
--border: oklch(0.3715 0 0);
|
||||
--input: oklch(0.3715 0 0);
|
||||
--ring: oklch(0.7686 0.1647 70.0804);
|
||||
--chart-1: oklch(0.8369 0.1644 84.4286);
|
||||
--chart-2: oklch(0.6658 0.1574 58.3183);
|
||||
--chart-3: oklch(0.4732 0.1247 46.2007);
|
||||
--chart-4: oklch(0.5553 0.1455 48.9975);
|
||||
--chart-5: oklch(0.4732 0.1247 46.2007);
|
||||
--sidebar: oklch(0.1684 0 0);
|
||||
--sidebar-foreground: oklch(0.9219 0 0);
|
||||
--sidebar-primary: oklch(0.7686 0.1647 70.0804);
|
||||
--sidebar-primary-foreground: oklch(1 0 0);
|
||||
--sidebar-accent: oklch(0.4732 0.1247 46.2007);
|
||||
--sidebar-accent-foreground: oklch(0.9243 0.1151 95.7459);
|
||||
--sidebar-border: oklch(0.3715 0 0);
|
||||
--sidebar-ring: oklch(0.7686 0.1647 70.0804);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--radius: 0.375rem;
|
||||
--font-sans: Inter, sans-serif;
|
||||
--font-serif: Source Serif 4, serif;
|
||||
--font-mono: JetBrains Mono, monospace;
|
||||
--shadow-color: hsl(0 0% 0%);
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-blur: 8px;
|
||||
--shadow-spread: -1px;
|
||||
--shadow-offset-x: 0px;
|
||||
--shadow-offset-y: 4px;
|
||||
--letter-spacing: 0em;
|
||||
--spacing: 0.25rem;
|
||||
--shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 8px 10px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { Editor } from '@tinymce/tinymce-react';
|
||||
import React from 'react';
|
||||
|
||||
// 1. Define as propriedades que nosso componente vai receber
|
||||
interface MainEditorProps {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
AudioWaveform,
|
||||
BookOpen,
|
||||
Bot,
|
||||
Command,
|
||||
Frame,
|
||||
GalleryVerticalEnd,
|
||||
House,
|
||||
HouseIcon,
|
||||
Map,
|
||||
PieChart,
|
||||
Settings2,
|
||||
SquareMousePointer,
|
||||
SquareTerminal,
|
||||
UsersIcon,
|
||||
} from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
import * as React from 'react';
|
||||
|
||||
import { NavMain } from '@/components/nav-main';
|
||||
import { NavProjects } from '@/components/nav-projects';
|
||||
|
|
@ -30,47 +25,17 @@ import {
|
|||
SidebarMenuItem,
|
||||
SidebarRail,
|
||||
} from '@/components/ui/sidebar';
|
||||
|
||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||
import Image from 'next/image';
|
||||
|
||||
// This is sample data.
|
||||
const data = {
|
||||
teams: [
|
||||
{
|
||||
name: 'Acme Inc',
|
||||
logo: GalleryVerticalEnd,
|
||||
plan: 'Enterprise',
|
||||
},
|
||||
{
|
||||
name: 'Acme Corp.',
|
||||
logo: AudioWaveform,
|
||||
plan: 'Startup',
|
||||
},
|
||||
{
|
||||
name: 'Evil Corp.',
|
||||
logo: Command,
|
||||
plan: 'Free',
|
||||
},
|
||||
],
|
||||
teams: [],
|
||||
navMain: [
|
||||
{
|
||||
title: 'Início',
|
||||
url: '#',
|
||||
icon: House,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Serviços',
|
||||
url: '/servicos/',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Administrativo',
|
||||
url: '#',
|
||||
icon: SquareTerminal,
|
||||
isActive: true,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Usuários',
|
||||
|
|
@ -78,12 +43,36 @@ const data = {
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Servicos',
|
||||
url: '#',
|
||||
icon: SquareMousePointer,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
url: '/servicos/dashboard/',
|
||||
},
|
||||
{
|
||||
title: 'Pedidos',
|
||||
url: '/servicos/pedidos/',
|
||||
},
|
||||
{
|
||||
title: 'Atos',
|
||||
url: '/servicos/atos/',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Pessoas',
|
||||
url: '#',
|
||||
icon: UsersIcon,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
url: '/administrativo/pessoas/dashboard',
|
||||
},
|
||||
{
|
||||
title: 'Físicas',
|
||||
url: '/administrativo/pessoas/fisicas',
|
||||
|
|
@ -100,6 +89,10 @@ const data = {
|
|||
icon: HouseIcon,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
url: '/administrativo/imoveis/dashboard',
|
||||
},
|
||||
{
|
||||
title: 'Urbanos',
|
||||
url: '/administrativo/imoveis/urbanos',
|
||||
|
|
@ -117,138 +110,113 @@ const data = {
|
|||
items: [
|
||||
{
|
||||
title: 'Reconhecimentos',
|
||||
url: '/cadastros/reconhecimentos/',
|
||||
url: '/administrativo/reconhecimentos/',
|
||||
},
|
||||
{
|
||||
title: 'Andamentos',
|
||||
url: '/cadastros/andamentos/',
|
||||
url: '/administrativo/andamentos/',
|
||||
},
|
||||
{
|
||||
title: 'Profissões',
|
||||
url: '/cadastros/profissoes/',
|
||||
url: '/administrativo/pessoas/profissoes/',
|
||||
},
|
||||
{
|
||||
title: 'Regimes/Bens',
|
||||
url: '/cadastros/regime-bens/',
|
||||
url: '/administrativo/pessoas/regimes-bens/',
|
||||
},
|
||||
{
|
||||
title: 'Tipos de Logradouros',
|
||||
url: '/cadastros/tipo-logradouro',
|
||||
},
|
||||
{
|
||||
title: 'Bairro',
|
||||
url: '/cadastros/bairro',
|
||||
url: '/administrativo/imoveis/tipos-logradouro',
|
||||
},
|
||||
{
|
||||
title: 'Estado Civil',
|
||||
url: '/cadastros/estado-civil',
|
||||
},
|
||||
{
|
||||
title: 'Tipo de Medida',
|
||||
url: '/cadastros/medida-tipo',
|
||||
},
|
||||
{
|
||||
title: 'Natureza Litígio (Censec)',
|
||||
url: '/cadastros/censec-natureza-litigio',
|
||||
},
|
||||
{
|
||||
title: 'Pessoas',
|
||||
url: '/cadastros/pessoas/complementos/',
|
||||
},
|
||||
{
|
||||
title: 'Cidades',
|
||||
url: '/cadastros/cidades/',
|
||||
},
|
||||
{
|
||||
title: 'Minuta',
|
||||
url: '/cadastros/minuta/',
|
||||
url: '/administrativo/pessoas/estados-civis',
|
||||
},
|
||||
{
|
||||
title: 'Regimes/Comunhão',
|
||||
url: '/cadastros/regime-comunhao/',
|
||||
url: '/administrativo/pessoas/regimes-comunhao/',
|
||||
},
|
||||
{
|
||||
title: 'Tipo de Medida',
|
||||
url: '/administrativo/medidas/tipos',
|
||||
},
|
||||
{
|
||||
title: 'Cidades',
|
||||
url: '/administrativo/cidades/',
|
||||
},
|
||||
{
|
||||
title: 'Bairro',
|
||||
url: '/administrativo/bairros',
|
||||
},
|
||||
{
|
||||
title: 'Minuta',
|
||||
url: '/administrativo/minutas/',
|
||||
},
|
||||
{
|
||||
title: 'Minuta/Naturezas',
|
||||
url: '/administrativo/minutas/naturezas',
|
||||
},
|
||||
{
|
||||
title: 'Censec/Tipo do Ato',
|
||||
url: '/administrativo/centrais/censec/tipos-atos',
|
||||
},
|
||||
{
|
||||
title: 'Censec/Qualidades',
|
||||
url: '/administrativo/centrais/censec/qualidades',
|
||||
},
|
||||
{
|
||||
title: 'Censec/Centrais',
|
||||
url: '/cadastros/censec/',
|
||||
url: '/administrativo/centrais/censec/centrais',
|
||||
},
|
||||
{
|
||||
title: "Censec Tipo Ato",
|
||||
url: "/cadastros/censec-tipoato"
|
||||
title: 'Censec/Natureza Litígio',
|
||||
url: '/administrativo/centrais/censec/naturezas-litigios',
|
||||
},
|
||||
{
|
||||
title: "Regimes/Comunhão",
|
||||
url: "/cadastros/regime-comunhao/",
|
||||
title: 'Tipos/Serviços',
|
||||
url: '/administrativo/tipos-servicos',
|
||||
},
|
||||
{
|
||||
title: 'Censec/Centrais',
|
||||
url: '/cadastros/censec/',
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Documentation',
|
||||
url: '#',
|
||||
icon: BookOpen,
|
||||
items: [
|
||||
{
|
||||
title: 'Introduction',
|
||||
url: '#',
|
||||
title: 'Atos/Partes Tipos',
|
||||
url: '/administrativo/atos/partes-tipos',
|
||||
},
|
||||
{
|
||||
title: 'Get Started',
|
||||
url: '#',
|
||||
title: 'Valores de Serviços',
|
||||
url: '/administrativo/valores-de-servicos',
|
||||
},
|
||||
{
|
||||
title: 'Tutorials',
|
||||
url: '#',
|
||||
title: 'Gramatica',
|
||||
url: '/administrativo/gramatica',
|
||||
},
|
||||
{
|
||||
title: 'Changelog',
|
||||
url: '#',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Settings',
|
||||
url: '#',
|
||||
icon: Settings2,
|
||||
items: [
|
||||
{
|
||||
title: 'General',
|
||||
url: '#',
|
||||
title: 'Cartório',
|
||||
url: '/administrativo/cartorio',
|
||||
},
|
||||
{
|
||||
title: 'Team',
|
||||
url: '#',
|
||||
title: 'Financeiro/Periodo',
|
||||
url: '/administrativo/financeiro/periodos',
|
||||
},
|
||||
{
|
||||
title: 'Billing',
|
||||
url: '#',
|
||||
title: 'Financeiro/Emolumentos',
|
||||
url: '/administrativo/financeiro/emolumentos',
|
||||
},
|
||||
{
|
||||
title: 'Limits',
|
||||
url: '#',
|
||||
title: 'Selos/Grupos',
|
||||
url: '/administrativo/selos/grupos',
|
||||
},
|
||||
{
|
||||
title: 'Financeiro/Cálculo Rápido',
|
||||
url: '/administrativo/financeiro/calculo-rapido',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
projects: [
|
||||
{
|
||||
name: 'Design Engineering',
|
||||
name: 'Escritura Publica de Compra e Venda',
|
||||
url: '#',
|
||||
icon: Frame,
|
||||
},
|
||||
{
|
||||
name: 'Sales & Marketing',
|
||||
url: '#',
|
||||
icon: PieChart,
|
||||
},
|
||||
{
|
||||
name: 'Travel',
|
||||
url: '#',
|
||||
icon: Map,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -268,16 +236,12 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|||
alt="Logo do site"
|
||||
width={100}
|
||||
height={100}
|
||||
className='rounded-lg'
|
||||
className="rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col gap-0.5 leading-none">
|
||||
<span className="font-semibold">
|
||||
Orius Tecnologia
|
||||
</span>
|
||||
<span className="">
|
||||
25.9.1
|
||||
</span>
|
||||
<span className="font-semibold">Orius Tecnologia</span>
|
||||
<span className="">25.9.1</span>
|
||||
</div>
|
||||
</a>
|
||||
</SidebarMenuButton>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue