Compare commits
100 commits
| 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 | ||
|
|
dfee9eb752 | ||
|
|
e01fa690a3 | ||
|
|
f9df3cd8a3 | ||
|
|
e98a293286 | ||
|
|
4c16b19184 | ||
|
|
de3a022800 | ||
|
|
4da16c3fe2 | ||
|
|
d1732558ff | ||
|
|
58630f8602 | ||
|
|
6b6f2e4fc8 | ||
|
|
2d37d4d421 | ||
|
|
fdd4cf7cfc | ||
|
|
bc2c2ef3dd | ||
|
|
b2e0d50dd6 | ||
|
|
97c958cb00 | ||
|
|
6fe6c86b5d | ||
|
|
b85cd6aeb9 | ||
|
|
88cb6f67c8 | ||
|
|
790c79ede6 | ||
|
|
06d55ec125 | ||
| e50818e52a | |||
| 79f2092882 | |||
| 8d44686717 | |||
| 7162a20d1f | |||
| b362968a4f | |||
| 23604033fe | |||
| feab092f6e | |||
| e39422776e | |||
| 8e035546e9 | |||
| 6051afc3e0 | |||
| 9b9f8b9454 | |||
| 2340cee82a | |||
| 0e21ebfe5b | |||
| 3faf0ebe5e | |||
| b9318f1059 | |||
| 64b897e7e9 | |||
|
|
7db6d27035 | ||
|
|
32924cd8da | ||
| 7af4c82dd1 | |||
|
|
3df00e38bc | ||
|
|
7fe725bdeb |
786 changed files with 20722 additions and 3408 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",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
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
|
WORKDIR /app
|
||||||
|
|
||||||
# Copia os arquivos de configuração do projeto
|
# Copia pacotes e instala dependências
|
||||||
COPY package.json package-lock.json ./
|
COPY package*.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
# Instala todas as dependências do projeto
|
# Copia o restante do código
|
||||||
# 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
|
|
||||||
COPY . .
|
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
|
EXPOSE 3000
|
||||||
|
|
||||||
# Define o comando para iniciar a aplicação em modo de desenvolvimento
|
# ---------- Executa o servidor ----------
|
||||||
# Isso ativará o servidor de desenvolvimento e a recarga automática
|
CMD ["node", "server.js"]
|
||||||
CMD ["npm", "run", "dev"]
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
# 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,74 +1,70 @@
|
||||||
import js from "@eslint/js";
|
import js from '@eslint/js';
|
||||||
import reactPlugin from "eslint-plugin-react";
|
import reactPlugin from 'eslint-plugin-react';
|
||||||
import reactHooks from "eslint-plugin-react-hooks";
|
import reactHooks from 'eslint-plugin-react-hooks';
|
||||||
import jsxA11y from "eslint-plugin-jsx-a11y";
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
||||||
import importPlugin from "eslint-plugin-import";
|
import importPlugin from 'eslint-plugin-import';
|
||||||
import tseslint from "typescript-eslint";
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
...tseslint.configs.recommended,
|
...tseslint.configs.recommended,
|
||||||
{
|
{
|
||||||
files: ["**/*.ts", "**/*.tsx"],
|
files: ['**/*.ts', '**/*.tsx'],
|
||||||
ignores: ["node_modules/**", ".next/**", "out/**", "dist/**"],
|
ignores: ['node_modules/**', '.next/**', 'out/**', 'dist/**'],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
ecmaVersion: "latest",
|
ecmaVersion: 'latest',
|
||||||
sourceType: "module",
|
sourceType: 'module',
|
||||||
parser: tseslint.parser,
|
parser: tseslint.parser,
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: "./tsconfig.json",
|
project: './tsconfig.json',
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
React: true,
|
React: true,
|
||||||
JSX: 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",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
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,12 +1,17 @@
|
||||||
import type { NextConfig } from 'next';
|
/** @type {import('next').NextConfig} */
|
||||||
|
const nextConfig = {
|
||||||
const nextConfig: NextConfig = {
|
// Gera build autônomo para rodar com "node server.js"
|
||||||
// Isso gera um diretório otimizado que inclui tudo o que a aplicação precisa para rodar
|
|
||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
eslint: {
|
|
||||||
// Desativa a verificação de lint durante o build
|
// Configurações gerais
|
||||||
ignoreDuringBuilds: true,
|
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;
|
||||||
|
|
|
||||||
1045
package-lock.json
generated
1045
package-lock.json
generated
File diff suppressed because it is too large
Load diff
20
package.json
20
package.json
|
|
@ -4,14 +4,17 @@
|
||||||
"version": "25.9.1",
|
"version": "25.9.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"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",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "next lint",
|
||||||
|
"postinstall": "shx mkdir -p public/libs && shx cp -r node_modules/tinymce public/libs/tinymce"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@faker-js/faker": "^10.0.0",
|
"@faker-js/faker": "^10.0.0",
|
||||||
"@hookform/resolvers": "^5.2.1",
|
"@hookform/resolvers": "^5.2.1",
|
||||||
|
"@onlyoffice/document-editor-react": "^2.1.1",
|
||||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||||
"@radix-ui/react-avatar": "^1.1.10",
|
"@radix-ui/react-avatar": "^1.1.10",
|
||||||
"@radix-ui/react-checkbox": "^1.3.3",
|
"@radix-ui/react-checkbox": "^1.3.3",
|
||||||
|
|
@ -20,9 +23,12 @@
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
||||||
"@radix-ui/react-label": "^2.1.7",
|
"@radix-ui/react-label": "^2.1.7",
|
||||||
"@radix-ui/react-popover": "^1.1.15",
|
"@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-select": "^2.2.6",
|
||||||
"@radix-ui/react-separator": "^1.1.7",
|
"@radix-ui/react-separator": "^1.1.8",
|
||||||
"@radix-ui/react-slot": "^1.2.3",
|
"@radix-ui/react-slot": "^1.2.4",
|
||||||
"@radix-ui/react-switch": "^1.2.6",
|
"@radix-ui/react-switch": "^1.2.6",
|
||||||
"@radix-ui/react-tabs": "^1.1.13",
|
"@radix-ui/react-tabs": "^1.1.13",
|
||||||
"@radix-ui/react-tooltip": "^1.2.8",
|
"@radix-ui/react-tooltip": "^1.2.8",
|
||||||
|
|
@ -32,7 +38,9 @@
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.1.1",
|
"cmdk": "^1.1.1",
|
||||||
"cookies-next": "^6.1.0",
|
"cookies-next": "^6.1.0",
|
||||||
|
"date-fns": "^3.6.0",
|
||||||
"faker-js": "^1.0.0",
|
"faker-js": "^1.0.0",
|
||||||
|
"framer-motion": "^12.23.24",
|
||||||
"input-otp": "^1.4.2",
|
"input-otp": "^1.4.2",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
|
|
@ -44,6 +52,7 @@
|
||||||
"react-dom": "19.1.0",
|
"react-dom": "19.1.0",
|
||||||
"react-hook-form": "^7.62.0",
|
"react-hook-form": "^7.62.0",
|
||||||
"react-masked-text": "^1.0.5",
|
"react-masked-text": "^1.0.5",
|
||||||
|
"recharts": "^3.3.0",
|
||||||
"sonner": "^2.0.7",
|
"sonner": "^2.0.7",
|
||||||
"tailwind-merge": "^3.3.1",
|
"tailwind-merge": "^3.3.1",
|
||||||
"tinymce": "^8.1.2",
|
"tinymce": "^8.1.2",
|
||||||
|
|
@ -51,6 +60,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/postcss": "^4",
|
"@tailwindcss/postcss": "^4",
|
||||||
|
"@types/date-fns": "^2.5.3",
|
||||||
"@types/js-cookie": "^3.0.6",
|
"@types/js-cookie": "^3.0.6",
|
||||||
"@types/jsonwebtoken": "^9.0.10",
|
"@types/jsonwebtoken": "^9.0.10",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
|
|
@ -58,6 +68,7 @@
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||||
"@typescript-eslint/parser": "^8.46.1",
|
"@typescript-eslint/parser": "^8.46.1",
|
||||||
|
"cross-env": "^10.1.0",
|
||||||
"eslint": "^9.38.0",
|
"eslint": "^9.38.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-import-resolver-typescript": "^4.4.4",
|
"eslint-import-resolver-typescript": "^4.4.4",
|
||||||
|
|
@ -69,6 +80,7 @@
|
||||||
"eslint-plugin-unused-imports": "^4.2.0",
|
"eslint-plugin-unused-imports": "^4.2.0",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.14",
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||||
|
"shx": "^0.4.0",
|
||||||
"tailwindcss": "^4",
|
"tailwindcss": "^4",
|
||||||
"tw-animate-css": "^1.3.7",
|
"tw-animate-css": "^1.3.7",
|
||||||
"typescript": "5.9.3",
|
"typescript": "5.9.3",
|
||||||
|
|
|
||||||
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,50 +0,0 @@
|
||||||
'use client';
|
|
||||||
|
|
||||||
import { useEffect } from 'react';
|
|
||||||
import { useParams } from 'next/navigation';
|
|
||||||
|
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
|
||||||
import { useGUsuarioReadHooks } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioReadHooks';
|
|
||||||
import Usuario from '@/packages/administrativo/interfaces/GUsuario/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);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
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 '../../../../../../packages/administrativo/schemas/GUsuario/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 '../../../../../../packages/administrativo/hooks/GUsuario/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 '../../../../../packages/administrativo/interfaces/GUsuario/GUsuarioInterface';
|
|
||||||
import { Button } from '@/components/ui/button';
|
|
||||||
import Link from 'next/link';
|
|
||||||
import { useGUsuarioIndexHook } from '../../../../../packages/administrativo/hooks/GUsuario/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 +1,5 @@
|
||||||
import TTBAndamentoServicoIndex from "@/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex";
|
import TTBAndamentoServicoIndex from '@/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex';
|
||||||
|
|
||||||
export default function TAtoParteTipo() {
|
export default function TAtoParteTipo() {
|
||||||
|
return <TTBAndamentoServicoIndex />;
|
||||||
return (
|
}
|
||||||
< TTBAndamentoServicoIndex />
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
import TAtoParteTipoIndex from "@/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex";
|
import TAtoParteTipoIndex from '@/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex';
|
||||||
|
|
||||||
export default function TAtoParteTipo() {
|
export default function TAtoParteTipo() {
|
||||||
|
return <TAtoParteTipoIndex />;
|
||||||
return (
|
}
|
||||||
< TAtoParteTipoIndex />
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GTBBairroIndex from "@/packages/administrativo/components/GTBBairro/GTBBairroIndex";
|
import GTBBairroIndex from '@/packages/administrativo/components/GTBBairro/GTBBairroIndex';
|
||||||
|
|
||||||
export default function GCidadePage() {
|
export default function GCidadePage() {
|
||||||
return (
|
return <GTBBairroIndex />;
|
||||||
< GTBBairroIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import GCartorioIndex from '@/packages/administrativo/components/GCartorio/GCartorioIndex';
|
||||||
|
|
||||||
|
export default function GCartorioPage() {
|
||||||
|
return <GCartorioIndex />;
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import TCensecTipoNaturezaIndex from "@/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex";
|
import TCensecTipoNaturezaIndex from '@/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex';
|
||||||
|
|
||||||
export default function TCensecTipoNaturezaPage() {
|
export default function TCensecTipoNaturezaPage() {
|
||||||
return (
|
return <TCensecTipoNaturezaIndex />;
|
||||||
< TCensecTipoNaturezaIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default function TCensecPage() {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import TCensecQualidadeIndex from "@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex";
|
import TCensecQualidadeIndex from '@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex';
|
||||||
|
|
||||||
export default function TCensecQualidadePage() {
|
export default function TCensecQualidadePage() {
|
||||||
return (
|
return <TCensecQualidadeIndex />;
|
||||||
< TCensecQualidadeIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import TCensecIndex from "@/packages/administrativo/components/TCensec/TCensecIndex";
|
import TCensecIndex from '@/packages/administrativo/components/TCensec/TCensecIndex';
|
||||||
|
|
||||||
export default function GTBEstadoCivilPage() {
|
export default function GTBEstadoCivilPage() {
|
||||||
return (
|
return <TCensecIndex />;
|
||||||
< TCensecIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import TCensecNaturezaLitigioIndex from "@/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex";
|
import TCensecNaturezaLitigioIndex from '@/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex';
|
||||||
|
|
||||||
export default function GCidadePage() {
|
export default function GCidadePage() {
|
||||||
return (
|
return <TCensecNaturezaLitigioIndex />;
|
||||||
< TCensecNaturezaLitigioIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import TCensecQualidadeIndex from "@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex";
|
import TCensecQualidadeIndex from '@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex';
|
||||||
|
|
||||||
export default function GTBEstadoCivilPage() {
|
export default function GTBEstadoCivilPage() {
|
||||||
return (
|
return <TCensecQualidadeIndex />;
|
||||||
< TCensecQualidadeIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import TCensecTipoAtoIndex from "@/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex";
|
import TCensecTipoAtoIndex from '@/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex';
|
||||||
|
|
||||||
export default function GTBEstadoCivilPage() {
|
export default function GTBEstadoCivilPage() {
|
||||||
return (
|
return <TCensecTipoAtoIndex />;
|
||||||
< TCensecTipoAtoIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GCidadeIndex from "@/packages/administrativo/components/GCidade/GCidadeIndex";
|
import GCidadeIndex from '@/packages/administrativo/components/GCidade/GCidadeIndex';
|
||||||
|
|
||||||
export default function GCidadePage() {
|
export default function GCidadePage() {
|
||||||
return (
|
return <GCidadeIndex />;
|
||||||
< 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';
|
'use client';
|
||||||
|
|
||||||
import TImovelIndex from "@/packages/administrativo/components/TImovel/TImovelIndex";
|
import TImovelIndex from '@/packages/administrativo/components/TImovel/TImovelIndex';
|
||||||
|
|
||||||
export default function TImovelRuralPage() {
|
export default function TImovelRuralPage() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GTBTipoLogradouroIndex from "@/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex";
|
import GTBTipoLogradouroIndex from '@/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex';
|
||||||
|
|
||||||
export default function GMedidaTipoPage() {
|
export default function GMedidaTipoPage() {
|
||||||
return (
|
return <GTBTipoLogradouroIndex />;
|
||||||
< GTBTipoLogradouroIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import TImovelIndex from "@/packages/administrativo/components/TImovel/TImovelIndex";
|
import TImovelIndex from '@/packages/administrativo/components/TImovel/TImovelIndex';
|
||||||
|
|
||||||
export default function TImovelUrbanoPage() {
|
export default function TImovelUrbanoPage() {
|
||||||
return (
|
return (
|
||||||
|
|
@ -10,4 +10,4 @@ export default function TImovelUrbanoPage() {
|
||||||
tipoClasse={1}
|
tipoClasse={1}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GMedidaTipoIndex from "@/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex";
|
import GMedidaTipoIndex from '@/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex';
|
||||||
|
|
||||||
export default function GMedidaTipoPage() {
|
export default function GMedidaTipoPage() {
|
||||||
return (
|
return <GMedidaTipoIndex />;
|
||||||
< GMedidaTipoIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
import GNaturezaIndex from "@/packages/administrativo/components/GNatureza/GNaturezaIndex";
|
import GNaturezaIndex from '@/packages/administrativo/components/GNatureza/GNaturezaIndex';
|
||||||
|
|
||||||
export default function GNaturezaPage() {
|
export default function GNaturezaPage() {
|
||||||
|
return <GNaturezaIndex sistema_id={2} />;
|
||||||
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 />;
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GTBEstadoCivilIndex from "@/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex";
|
import GTBEstadoCivilIndex from '@/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex';
|
||||||
|
|
||||||
export default function GTBEstadoCivilPage() {
|
export default function GTBEstadoCivilPage() {
|
||||||
return (
|
return <GTBEstadoCivilIndex />;
|
||||||
< GTBEstadoCivilIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,5 @@
|
||||||
import TPessoaFisicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaIndex';
|
import TPessoaFisicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaIndex';
|
||||||
|
|
||||||
export default function TPessoaFisica() {
|
export default function TPessoaFisica() {
|
||||||
return (
|
return <TPessoaFisicaIndex />;
|
||||||
<TPessoaFisicaIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,5 @@
|
||||||
import TPessoaJuridicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaIndex';
|
import TPessoaJuridicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaIndex';
|
||||||
|
|
||||||
export default function TPessoaFisica() {
|
export default function TPessoaFisica() {
|
||||||
|
return <TPessoaJuridicaIndex />;
|
||||||
return (
|
|
||||||
<TPessoaJuridicaIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GTBProfissaoIndex from "@/packages/administrativo/components/GTBProfissao/GTBProfissaoIndex";
|
import GTBProfissaoIndex from '@/packages/administrativo/components/GTBProfissao/GTBProfissaoIndex';
|
||||||
|
|
||||||
export default function GTBEstadoCivilPage() {
|
export default function GTBEstadoCivilPage() {
|
||||||
return (
|
return <GTBProfissaoIndex />;
|
||||||
< GTBProfissaoIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GTBRegimeBensIndex from "@/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensIndex";
|
import GTBRegimeBensIndex from '@/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensIndex';
|
||||||
|
|
||||||
export default function GTBRegimeBensPage() {
|
export default function GTBRegimeBensPage() {
|
||||||
return (
|
return <GTBRegimeBensIndex />;
|
||||||
< GTBRegimeBensIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import GTBRegimeComunhaoIndex from "@/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex";
|
import GTBRegimeComunhaoIndex from '@/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex';
|
||||||
|
|
||||||
export default function GTBRegimeBensPage() {
|
export default function GTBRegimeBensPage() {
|
||||||
return (
|
return <GTBRegimeComunhaoIndex />;
|
||||||
< GTBRegimeComunhaoIndex />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
import TTBReconhecimentoTipoIndex from "@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndex";
|
import TTBReconhecimentoTipoIndex from '@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndex';
|
||||||
|
|
||||||
export default function TAtoParteTipo() {
|
export default function TAtoParteTipo() {
|
||||||
|
return <TTBReconhecimentoTipoIndex />;
|
||||||
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';
|
'use client';
|
||||||
|
|
||||||
import { useEffect, useState } from 'react';
|
|
||||||
import { useParams } from 'next/navigation';
|
import { useParams } from 'next/navigation';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
|
||||||
import MainEditor from '@/components/MainEditor';
|
import MainEditor from '@/components/MainEditor';
|
||||||
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import Loading from '@/shared/components/loading/loading';
|
|
||||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||||
|
import Loading from '@/shared/components/loading/loading';
|
||||||
|
|
||||||
export default function TMinutaDetalhes() {
|
export default function TMinutaDetalhes() {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import z from 'zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useForm, Controller } from 'react-hook-form';
|
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 { Button } from '@/components/ui/button';
|
||||||
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Checkbox } from '@/components/ui/checkbox';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
|
|
@ -17,11 +19,8 @@ import {
|
||||||
} from '@/components/ui/form';
|
} from '@/components/ui/form';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
|
|
||||||
import MainEditor from '@/components/MainEditor';
|
|
||||||
import { TMinutaSchema } from '@/packages/administrativo/schemas/TMinuta/TMinutaSchema';
|
|
||||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { TMinutaSchema } from '@/packages/administrativo/schemas/TMinuta/TMinutaSchema';
|
||||||
|
|
||||||
type FormValues = z.infer<typeof TMinutaSchema>;
|
type FormValues = z.infer<typeof TMinutaSchema>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,19 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useEffect, useState, useCallback } from 'react';
|
import { useEffect, useState, useCallback } from 'react';
|
||||||
|
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
|
||||||
|
|
||||||
import Header from '@/shared/components/structure/Header';
|
|
||||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
|
||||||
import Loading from '@/shared/components/loading/loading';
|
|
||||||
|
|
||||||
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
|
||||||
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
||||||
|
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
||||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
|
||||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
|
||||||
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
|
|
||||||
|
|
||||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
|
||||||
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
|
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 Header from '@/shared/components/structure/Header';
|
||||||
|
|
||||||
export default function TMinutaPage() {
|
export default function TMinutaPage() {
|
||||||
// Hooks de leitura e escrita
|
// Hooks de leitura e escrita
|
||||||
|
|
|
||||||
|
|
@ -1,100 +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 TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface'; // Import alterado
|
|
||||||
|
|
||||||
// Tipagem das props do componente da tabela
|
|
||||||
interface TServicoTipoTableProps { // Nome da interface alterado
|
|
||||||
data: TServicoTipoInterface[]; // lista de tipos de serviço
|
|
||||||
onEdit: (item: TServicoTipoInterface, isEditingFormStatus: boolean) => void; // callback para edição
|
|
||||||
onDelete: (item: TServicoTipoInterface, isEditingFormStatus: boolean) => void; // callback para exclusão
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Componente principal da tabela de Tipos de Serviço
|
|
||||||
*/
|
|
||||||
export default function TServicoTipoTable({ data, onEdit, onDelete }: TServicoTipoTableProps) {
|
|
||||||
return (
|
|
||||||
<Table className="w-full table-fixed">
|
|
||||||
{/* Cabeçalho da tabela */}
|
|
||||||
<TableHeader>
|
|
||||||
<TableRow>
|
|
||||||
<TableHead className="w-15 font-bold">#</TableHead>
|
|
||||||
{/* As colunas IBGE e UF foram removidas */}
|
|
||||||
<TableHead className="font-bold">Descrição</TableHead>
|
|
||||||
<TableHead className="text-right"></TableHead>
|
|
||||||
</TableRow>
|
|
||||||
</TableHeader>
|
|
||||||
|
|
||||||
{/* Corpo da tabela */}
|
|
||||||
<TableBody>
|
|
||||||
{data.map((item) => (
|
|
||||||
// Assumindo que o ID do Tipo de Serviço é 'servico_tipo_id'
|
|
||||||
<TableRow key={item.servico_tipo_id} className="cursor-pointer">
|
|
||||||
{/* ID do Tipo de Serviço */}
|
|
||||||
<TableCell>{item.servico_tipo_id}</TableCell>
|
|
||||||
|
|
||||||
{/* Nome/descrição do Tipo de Serviço (descricao) */}
|
|
||||||
<TableCell>{item.descricao}</TableCell>
|
|
||||||
{/* As células de IBGE e UF foram removidas */}
|
|
||||||
|
|
||||||
{/* Ações (menu dropdown) */}
|
|
||||||
<TableCell className="text-right">
|
|
||||||
<DropdownMenu>
|
|
||||||
{/* Botão de disparo do menu */}
|
|
||||||
<DropdownMenuTrigger asChild>
|
|
||||||
<Button variant="outline" size="icon" className="cursor-pointer">
|
|
||||||
<EllipsisIcon />
|
|
||||||
</Button>
|
|
||||||
</DropdownMenuTrigger>
|
|
||||||
|
|
||||||
{/* Conteúdo do menu */}
|
|
||||||
<DropdownMenuContent side="left" align="start">
|
|
||||||
<DropdownMenuGroup>
|
|
||||||
{/* Opção editar */}
|
|
||||||
<DropdownMenuItem
|
|
||||||
className="cursor-pointer"
|
|
||||||
onSelect={() => onEdit(item, true)}
|
|
||||||
>
|
|
||||||
<PencilIcon className="mr-2 h-4 w-4" />
|
|
||||||
Editar
|
|
||||||
</DropdownMenuItem>
|
|
||||||
|
|
||||||
<DropdownMenuSeparator />
|
|
||||||
|
|
||||||
{/* Opção remover */}
|
|
||||||
<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,27 +0,0 @@
|
||||||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
|
||||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
|
||||||
|
|
||||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
|
||||||
import API from '@/shared/services/api/Api';
|
|
||||||
|
|
||||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
|
||||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
|
||||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
|
||||||
|
|
||||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
|
||||||
async function executeGEmolumentoIndexData(data: GEmolumentoReadInterface) {
|
|
||||||
// Cria uma nova instância da classe API para enviar a requisição
|
|
||||||
const api = new API();
|
|
||||||
|
|
||||||
// Concatena o endpoint com a query string (caso existam parâmetros)
|
|
||||||
const endpoint = `administrativo/g_emolumento/${data.sistema_id}`;
|
|
||||||
|
|
||||||
// Envia uma requisição GET para o endpoint 'administrativo/g_marcacao_tipo/'
|
|
||||||
return await api.send({
|
|
||||||
method: Methods.GET,
|
|
||||||
endpoint: endpoint,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exporta a função encapsulada pelo handler de erro, garantindo tratamento uniforme em caso de falhas
|
|
||||||
export const GEmolumentoIndexData = withClientErrorHandler(executeGEmolumentoIndexData);
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
|
||||||
import API from '@/shared/services/api/Api'; //
|
|
||||||
|
|
||||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
|
||||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
|
||||||
|
|
||||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
|
||||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
|
||||||
|
|
||||||
// Função assíncrona que implementa a lógica de buscar todos os tipos de serviço (GET)
|
|
||||||
async function executeTServicoTipoIndexData() {
|
|
||||||
|
|
||||||
// Instancia o cliente da API para enviar a requisição
|
|
||||||
const api = new API(); //
|
|
||||||
|
|
||||||
// Executa a requisição para a API com o método apropriado e o endpoint da tabela t_servico_tipo
|
|
||||||
return await api.send({
|
|
||||||
method: Methods.GET, // GET listar todos os itens
|
|
||||||
endpoint: `administrativo/t_servico_tipo/` // Endpoint atualizado
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exporta a função de listar tipos de serviço já encapsulada com tratamento de erros
|
|
||||||
export const TServicoTipoIndexData = withClientErrorHandler(executeTServicoTipoIndexData);
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
|
||||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
|
||||||
|
|
||||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
|
||||||
import API from '@/shared/services/api/Api';
|
|
||||||
|
|
||||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
|
||||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
|
||||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
|
||||||
|
|
||||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
|
||||||
async function executeTTBReconhecimentoTipoIndexData(data: TTBReconhecimentoTipoReadInterface) {
|
|
||||||
// Cria uma nova instância da classe API para enviar a requisição
|
|
||||||
const api = new API();
|
|
||||||
|
|
||||||
// Concatena o endpoint com a query string (caso existam parâmetros)
|
|
||||||
const endpoint = `administrativo/t_tb_reconhecimentotipo/`;
|
|
||||||
|
|
||||||
// Envia uma requisição GET para o endpoint 'administrativo/g_marcacao_tipo/'
|
|
||||||
return await api.send({
|
|
||||||
method: Methods.GET,
|
|
||||||
endpoint: endpoint,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exporta a função encapsulada pelo handler de erro, garantindo tratamento uniforme em caso de falhas
|
|
||||||
export const TTBReconhecimentoTipoIndexData = withClientErrorHandler(executeTTBReconhecimentoTipoIndexData);
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
|
||||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
|
||||||
|
|
||||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
|
||||||
import { useMemo, useState } from 'react';
|
|
||||||
|
|
||||||
// Importa a interface que define a estrutura dos dados de "GEmolumento"
|
|
||||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
|
||||||
|
|
||||||
// Importa o serviço responsável por buscar os dados de "GEmolumento" na API
|
|
||||||
import { GEmolumentoIndexService } from '../../_services/g_emolumento/GEmolumentoIndexService';
|
|
||||||
import { GEmolumentoInterface } from '../../_interfaces/GEmolumentoInterface';
|
|
||||||
|
|
||||||
|
|
||||||
// Hook personalizado para leitura (consulta) dos emolumentos
|
|
||||||
export const useGEmolumentoReadHook = () => {
|
|
||||||
// Obtém a função que atualiza a resposta global do sistema
|
|
||||||
const { setResponse } = useResponse();
|
|
||||||
|
|
||||||
// Define o estado local que armazenará a lista de emolumentos
|
|
||||||
const [gEmolumento, setGEmolumento] = useState<GEmolumentoInterface[]>([]);
|
|
||||||
|
|
||||||
// Função responsável por buscar os dados da API e atualizar o estado
|
|
||||||
const fetchGEmolumento = async (data: GEmolumentoReadInterface) => {
|
|
||||||
// Executa o serviço que faz a requisição à API
|
|
||||||
const response = await GEmolumentoIndexService(data);
|
|
||||||
|
|
||||||
// Atualiza o estado local com os dados retornados
|
|
||||||
setGEmolumento(response.data);
|
|
||||||
|
|
||||||
// Atualiza o contexto global de resposta (ex: para exibir alertas ou mensagens)
|
|
||||||
setResponse(response);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Retorna os dados e a função de busca, memorizando o valor para evitar recriações desnecessárias
|
|
||||||
return useMemo(() => ({ gEmolumento, fetchGEmolumento }), [gEmolumento, fetchGEmolumento]);
|
|
||||||
};
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
|
||||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
|
||||||
|
|
||||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
|
||||||
import { useMemo, useState } from 'react';
|
|
||||||
|
|
||||||
// Importa a interface que define a estrutura dos dados de "TTBReconhecimentoTipo"
|
|
||||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
|
||||||
import { TTBReconhecimentoTipoInterface } from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
|
||||||
|
|
||||||
// Importa o serviço responsável por buscar os dados de "TTBReconhecimentoTipo" na API
|
|
||||||
import { TTBReconhecimentoTipoIndexService } from '../../_services/t_tb_reconhecimentotipo/TTBReconhecimentoTipoIndexService';
|
|
||||||
|
|
||||||
|
|
||||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
|
||||||
export const useTTBReconhecimentoTipoReadHook = () => {
|
|
||||||
// Obtém a função que atualiza a resposta global do sistema
|
|
||||||
const { setResponse } = useResponse();
|
|
||||||
|
|
||||||
// Define o estado local que armazenará a lista de tipos de marcação
|
|
||||||
const [tTBReconhecimentoTipo, setTTBReconhecimentoTipo] = useState<TTBReconhecimentoTipoInterface[]>([]);
|
|
||||||
|
|
||||||
// Função responsável por buscar os dados da API e atualizar o estado
|
|
||||||
const fetchTTBReconhecimentoTipo = async (data: TTBReconhecimentoTipoReadInterface) => {
|
|
||||||
// Executa o serviço que faz a requisição à API
|
|
||||||
const response = await TTBReconhecimentoTipoIndexService(data);
|
|
||||||
|
|
||||||
// Atualiza o estado local com os dados retornados
|
|
||||||
setTTBReconhecimentoTipo(response.data);
|
|
||||||
|
|
||||||
// Atualiza o contexto global de resposta (ex: para exibir alertas ou mensagens)
|
|
||||||
setResponse(response);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Retorna os dados e a função de busca, memorizando o valor para evitar recriações desnecessárias
|
|
||||||
return useMemo(() => ({ tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo }), [tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo]);
|
|
||||||
};
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
// Interface que representa a tabela C_CAIXA_SERVICO
|
|
||||||
export interface CCaixaServicoInterface {
|
|
||||||
interno_sistema?: string; // VARCHAR(1)
|
|
||||||
caixa_servico_id: number; // NUMERIC(10,2) NOT NULL - Chave primária
|
|
||||||
descricao?: string; // VARCHAR(60)
|
|
||||||
situacao?: string; // VARCHAR(1)
|
|
||||||
tipo_transacao?: string; // VARCHAR(1)
|
|
||||||
sistema_id?: number; // NUMERIC(14,3)
|
|
||||||
selo_grupo_id?: number; // NUMERIC(10,2)
|
|
||||||
emitir_relatorio?: string; // VARCHAR(1)
|
|
||||||
repasse?: string; // VARCHAR(1)
|
|
||||||
repetir_descricao?: string; // VARCHAR(1)
|
|
||||||
codigo_conta?: number; // NUMERIC(10,2)
|
|
||||||
tipo_conta_carneleao?: string; // VARCHAR(60)
|
|
||||||
centro_de_custa_id?: number; // NUMERIC(10,2) - Chave estrangeira
|
|
||||||
devolucao_juizo?: string; // VARCHAR(1)
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
// Interface que representa a tabela G_EMOLUMENTO
|
|
||||||
export interface GEmolumentoInterface {
|
|
||||||
emolumento_id?: number; // NUMERIC(10,2) - Chave primária
|
|
||||||
descricao?: string; // VARCHAR(260)
|
|
||||||
tipo?: string; // VARCHAR(1)
|
|
||||||
sistema_id?: number; // NUMERIC(10,2)
|
|
||||||
selo_grupo_id?: number; // NUMERIC(10,2)
|
|
||||||
reg_averb?: string; // VARCHAR(1)
|
|
||||||
pre_definido?: string; // VARCHAR(1)
|
|
||||||
situacao?: string; // VARCHAR(1)
|
|
||||||
situacao_ri?: string; // VARCHAR(1)
|
|
||||||
com_reducao?: string; // VARCHAR(1)
|
|
||||||
motivo_reducao?: string; // VARCHAR(120)
|
|
||||||
valor_maximo_certidao?: number; // NUMERIC(14,3)
|
|
||||||
tipo_objetivo?: string; // VARCHAR(3)
|
|
||||||
modelo_tag?: string; // VARCHAR(3)
|
|
||||||
codigo_nota_id?: number; // NUMERIC(10,2)
|
|
||||||
convenio_codhab?: string; // VARCHAR(1)
|
|
||||||
item_df?: string; // VARCHAR(10)
|
|
||||||
}
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
// Interface que representa a tabela G_EMOLUMENTO_ITEM (inferido)
|
|
||||||
export interface GEmolumentoItemInterface {
|
|
||||||
valor_emolumento?: number; // NUMERIC(14,3)
|
|
||||||
emolumento_item_id: number; // NUMERIC(10,2) NOT NULL - Chave primária (assumida)
|
|
||||||
emolumento_id?: number; // NUMERIC(10,2)
|
|
||||||
valor_inicio?: number; // NUMERIC(14,3)
|
|
||||||
valor_fim?: number; // NUMERIC(14,3)
|
|
||||||
valor_taxa_judiciaria?: number; // NUMERIC(14,3)
|
|
||||||
emolumento_periodo_id?: number; // NUMERIC(10,2)
|
|
||||||
codigo?: number; // NUMERIC(10,2)
|
|
||||||
pagina_extra?: number; // NUMERIC(10,2)
|
|
||||||
valor_pagina_extra?: number; // NUMERIC(14,3)
|
|
||||||
valor_outra_taxa1?: number; // NUMERIC(14,3)
|
|
||||||
codigo_selo?: string; // VARCHAR(30)
|
|
||||||
valor_fundo_ri?: number; // NUMERIC(14,3)
|
|
||||||
codigo_tabela?: string; // VARCHAR(30)
|
|
||||||
selo_grupo_id?: number; // NUMERIC(10,2)
|
|
||||||
codigo_km?: string; // VARCHAR(30)
|
|
||||||
emolumento_acresce?: number; // NUMERIC(14,3)
|
|
||||||
taxa_acresce?: number; // NUMERIC(14,3)
|
|
||||||
funcivil_acresce?: number; // NUMERIC(14,3)
|
|
||||||
valor_fracao?: number; // NUMERIC(14,3)
|
|
||||||
valor_por_excedente_emol?: number; // NUMERIC(14,3)
|
|
||||||
valor_por_excedente_tj?: number; // NUMERIC(14,3)
|
|
||||||
valor_por_excedente_fundo?: number; // NUMERIC(14,3)
|
|
||||||
valor_limite_excedente_emol?: number; // NUMERIC(14,3)
|
|
||||||
valor_limite_excedente_tj?: number; // NUMERIC(14,3)
|
|
||||||
valor_limite_excedente_fundo?: number; // NUMERIC(14,3)
|
|
||||||
fundo_selo?: number; // NUMERIC(14,3)
|
|
||||||
distribuicao?: number; // NUMERIC(14,3)
|
|
||||||
vrc_ext?: number; // NUMERIC(10,2) - Renomeado de VRCEXT para vrc_ext (convenção)
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export interface GEmolumentoReadInterface {
|
|
||||||
sistema_id?: number
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
// Interface que representa a tabela T_TB_RECONHECIMENTOTIPO
|
|
||||||
export interface TServicoEtiquetaInterface {
|
|
||||||
servico_etiqueta_id?: number; // NUMERIC(10,2) NOT NULL - Chave primária
|
|
||||||
etiqueta_modelo_id?: number; // NUMERIC(10,2)
|
|
||||||
servico_tipo_id?: number; // NUMERIC(10,2)
|
|
||||||
descricao?: string
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
export default interface TServicoTipoInterface {
|
|
||||||
servico_tipo_id?: number; // SERVICO_TIPO_ID NUMERIC(10,2) NOT NULL (PK)
|
|
||||||
descricao: string; // DESCRICAO VARCHAR(60)
|
|
||||||
valor?: number; // VALOR NUMERIC(14,3)
|
|
||||||
requer_autorizacao?: string; // REQUER_AUTORIZACAO VARCHAR(1)
|
|
||||||
requer_biometria?: string; // REQUER_BIOMETRIA VARCHAR(1)
|
|
||||||
tipo_pessoa?: string; // TIPO_PESSOA VARCHAR(1)
|
|
||||||
tb_reconhecimentotipo_id?: number; // TB_RECONHECIMENTOTIPO_ID NUMERIC(10,2) (FK)
|
|
||||||
requer_abonador?: string; // REQUER_ABONADOR VARCHAR(1)
|
|
||||||
situacao?: string; // SITUACAO VARCHAR(1)
|
|
||||||
requer_cpf?: string; // REQUER_CPF VARCHAR(1)
|
|
||||||
servico_padrao?: string; // SERVICO_PADRAO VARCHAR(1)
|
|
||||||
maximo_pessoa?: number; // MAXIMO_PESSOA NUMERIC(10,2)
|
|
||||||
alterar_valor?: string; // ALTERAR_VALOR VARCHAR(1)
|
|
||||||
servico_caixa_id?: number; // SERVICO_CAIXA_ID NUMERIC(10,2)
|
|
||||||
caixa_servico_id?: number; // LIBERAR_DESCONTO VARCHAR(1)
|
|
||||||
valor_fixo?: string; // VALOR_FIXO VARCHAR(1)
|
|
||||||
emolumento_id?: number; // EMOLUMENTO_ID NUMERIC(10,2) (FK)
|
|
||||||
emolumento_obrigatorio?: number; // EMOLUMENTO_OBRIGATORIO NUMERIC(10,2) (FK)
|
|
||||||
ato_praticado?: string; // ATO_PRATICADO VARCHAR(1)
|
|
||||||
selar?: string; // SELAR VARCHAR(1)
|
|
||||||
frenteverso?: string; // FRENTEVERSO VARCHAR(1)
|
|
||||||
etiqueta_unica?: string; // ETIQUETA_UNICA VARCHAR(1)
|
|
||||||
transferencia_veiculo?: string; // TRANSFERENCIA_VEICULO VARCHAR(1)
|
|
||||||
usar_a4?: string; // USAR_A4 VARCHAR(1)
|
|
||||||
averbacao?: string; // AVERBACAO VARCHAR(1)
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
// Interface que representa a tabela T_TB_RECONHECIMENTOTIPO
|
|
||||||
export interface TTbReconhecimentoTipoInterface {
|
|
||||||
tb_reconhecimentotipo_id: number; // NUMERIC(10,2) NOT NULL - Chave primária
|
|
||||||
descricao?: string; // VARCHAR(30)
|
|
||||||
situacao?: string; // VARCHAR(1)
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
export interface TTBReconhecimentoTipoReadInterface {
|
|
||||||
tb_reconhecimentotipo_id?: number,
|
|
||||||
descricao?: string
|
|
||||||
}
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
import z from "zod";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tipos utilitários para campos simples
|
|
||||||
*/
|
|
||||||
const SN = z.enum(["S", "N"]).default("N"); // Campos do tipo Sim/Não
|
|
||||||
const AI = z.enum(["A", "I"]).default("A"); // Situação Ativo/Inativo
|
|
||||||
const OneCharString = z.string().max(1, "Deve ter no máximo 1 caractere").optional();
|
|
||||||
const RequiredString = z.string().min(1, "O campo é obrigatório");
|
|
||||||
const OptionalNumber = z.number().optional();
|
|
||||||
const RequiredNumber = z.number();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Schema principal baseado na DDL e adaptado ao formulário React
|
|
||||||
*/
|
|
||||||
export const TServicoTipoSchema = z.object({
|
|
||||||
// Identificador
|
|
||||||
servico_tipo_id: RequiredNumber.describe("ID do Tipo de Serviço").optional(),
|
|
||||||
|
|
||||||
// Campos principais
|
|
||||||
descricao: z.string().max(60, "A descrição deve ter no máximo 60 caracteres").optional(),
|
|
||||||
categoria: z.string().optional(),
|
|
||||||
|
|
||||||
// Controle de flags (S/N)
|
|
||||||
frenteverso: SN.optional(),
|
|
||||||
averbacao: SN.optional(),
|
|
||||||
transferencia_veiculo: SN.optional(),
|
|
||||||
usar_a4: SN.optional(),
|
|
||||||
etiqueta_unica: SN.optional(),
|
|
||||||
selar: SN.optional(),
|
|
||||||
servico_padrao: SN.optional(),
|
|
||||||
// lancar_taxa: SN.optional(),
|
|
||||||
// lancar_fundesp: SN.optional(),
|
|
||||||
// liberar_desconto: SN.optional(),
|
|
||||||
// fundesp_automatica: SN.optional(),
|
|
||||||
// lancar_valor_documento: SN.optional(),
|
|
||||||
valor_fixo: SN.optional(),
|
|
||||||
ato_praticado: SN.optional(),
|
|
||||||
// apresentante_selo: SN.optional(),
|
|
||||||
// renovacao_cartao: SN.optional(),
|
|
||||||
|
|
||||||
// Situação
|
|
||||||
situacao: AI,
|
|
||||||
|
|
||||||
// Campos numéricos
|
|
||||||
valor: OptionalNumber,
|
|
||||||
maximo_pessoa: OptionalNumber,
|
|
||||||
servico_caixa_id: OptionalNumber,
|
|
||||||
emolumento_id: z.number().nullable(),
|
|
||||||
emolumento_obrigatorio: z.number().nullable(),
|
|
||||||
|
|
||||||
// Relacionamentos e permissões
|
|
||||||
tipo_item: OneCharString,
|
|
||||||
requer_autorizacao: OneCharString,
|
|
||||||
requer_biometria: OneCharString,
|
|
||||||
tipo_pessoa: OneCharString,
|
|
||||||
tb_reconhecimentotipo_id: OptionalNumber,
|
|
||||||
// tipo_permissao_cpf: OneCharString,
|
|
||||||
requer_abonador: OneCharString,
|
|
||||||
// requer_representante: OneCharString,
|
|
||||||
requer_cpf: OneCharString,
|
|
||||||
// alterar_valor: OneCharString,
|
|
||||||
// pagina_acrescida: OneCharString,
|
|
||||||
|
|
||||||
// Campos auxiliares usados apenas no formulário (não persistidos)
|
|
||||||
valor_emolumento: z.number().optional(),
|
|
||||||
valor_taxa_judiciaria: z.number().optional(),
|
|
||||||
fundesp_valor: z.number().optional(),
|
|
||||||
valor_total: z.number().optional(),
|
|
||||||
etiquetas_carimbos: z.any().optional(),
|
|
||||||
emolumento: z.any().optional(),
|
|
||||||
emolumento_auxiliar: z.any().optional(),
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tipo inferido do schema — usado diretamente no useForm
|
|
||||||
*/
|
|
||||||
export type TServicoTipoFormValues = z.infer<typeof TServicoTipoSchema>;
|
|
||||||
|
|
@ -2,8 +2,8 @@ import type { Metadata } from 'next';
|
||||||
import { Geist, Geist_Mono } from 'next/font/google';
|
import { Geist, Geist_Mono } from 'next/font/google';
|
||||||
import '../globals.css';
|
import '../globals.css';
|
||||||
|
|
||||||
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
|
|
||||||
import { AppSidebar } from '@/components/app-sidebar';
|
import { AppSidebar } from '@/components/app-sidebar';
|
||||||
|
import { ThemeProvider } from '@/components/theme-provider';
|
||||||
import {
|
import {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
BreadcrumbItem,
|
BreadcrumbItem,
|
||||||
|
|
@ -15,7 +15,9 @@ import {
|
||||||
import { Separator } from '@/components/ui/separator';
|
import { Separator } from '@/components/ui/separator';
|
||||||
import { SidebarInset, SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
|
import { SidebarInset, SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
|
||||||
import { Toaster } from '@/components/ui/sonner';
|
import { Toaster } from '@/components/ui/sonner';
|
||||||
|
|
||||||
import Response from '../../shared/components/response/response';
|
import Response from '../../shared/components/response/response';
|
||||||
|
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
|
||||||
|
|
||||||
const geistSans = Geist({
|
const geistSans = Geist({
|
||||||
variable: '--font-geist-sans',
|
variable: '--font-geist-sans',
|
||||||
|
|
@ -35,50 +37,46 @@ export const metadata: Metadata = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||||
children,
|
|
||||||
}: Readonly<{
|
|
||||||
children: React.ReactNode;
|
|
||||||
}>) {
|
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en" suppressHydrationWarning>
|
||||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
|
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
|
||||||
<SidebarProvider>
|
<ThemeProvider>
|
||||||
<AppSidebar />
|
<SidebarProvider>
|
||||||
<SidebarInset>
|
<AppSidebar />
|
||||||
<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">
|
<SidebarInset>
|
||||||
<SidebarTrigger className="-ml-1" />
|
<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">
|
||||||
<Separator
|
<div className="flex items-center gap-2 px-4">
|
||||||
orientation="vertical"
|
<SidebarTrigger className="-ml-1" />
|
||||||
className="mr-2 data-[orientation=vertical]:h-4"
|
<Separator
|
||||||
/>
|
orientation="vertical"
|
||||||
<Breadcrumb>
|
className="mr-2 data-[orientation=vertical]:h-4"
|
||||||
<BreadcrumbList>
|
/>
|
||||||
<BreadcrumbItem className="hidden md:block">
|
<Breadcrumb>
|
||||||
<BreadcrumbLink href="#">
|
<BreadcrumbList>
|
||||||
Building Your Application
|
<BreadcrumbItem className="hidden md:block">
|
||||||
</BreadcrumbLink>
|
<BreadcrumbLink href="#">Building Your Application</BreadcrumbLink>
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
<BreadcrumbSeparator className="hidden md:block" />
|
<BreadcrumbSeparator className="hidden md:block" />
|
||||||
<BreadcrumbItem>
|
<BreadcrumbItem>
|
||||||
<BreadcrumbPage>
|
<BreadcrumbPage>Data Fetching</BreadcrumbPage>
|
||||||
Data Fetching
|
</BreadcrumbItem>
|
||||||
</BreadcrumbPage>
|
</BreadcrumbList>
|
||||||
</BreadcrumbItem>
|
</Breadcrumb>
|
||||||
</BreadcrumbList>
|
</div>
|
||||||
</Breadcrumb>
|
</header>
|
||||||
</div>
|
|
||||||
</header>
|
<ResponseProvider>
|
||||||
<ResponseProvider>
|
<div className="flex flex-1 flex-col gap-4 p-4 pt-0">
|
||||||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0">
|
{children}
|
||||||
{children}
|
<Toaster richColors position="top-center" />
|
||||||
<Toaster richColors position="top-center" />
|
<Response />
|
||||||
<Response />
|
</div>
|
||||||
</div>
|
</ResponseProvider>
|
||||||
</ResponseProvider>
|
</SidebarInset>
|
||||||
</SidebarInset>
|
</SidebarProvider>
|
||||||
</SidebarProvider>
|
</ThemeProvider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,51 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
const { userAuthenticated } = useGUsuarioGetJWTHook();
|
const { userAuthenticated } = useGUsuarioGetJWTHook();
|
||||||
|
|
||||||
// Inicializa time como null para renderizar só no cliente
|
// Inicializa time como null para renderizar só no cliente
|
||||||
const [time, setTime] = useState<Date | null>(null);
|
const [time, setTime] = useState<Date | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTime(new Date()); // define data inicial no cliente
|
setTime(new Date()); // define data inicial no cliente
|
||||||
const interval = setInterval(() => setTime(new Date()), 1000);
|
const interval = setInterval(() => setTime(new Date()), 1000);
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Se ainda não temos a hora, renderiza nada para evitar mismatch
|
// Se ainda não temos a hora, renderiza nada para evitar mismatch
|
||||||
if (!time || !userAuthenticated?.data) return null;
|
if (!time || !userAuthenticated?.data) return null;
|
||||||
|
|
||||||
const hours = time.getHours();
|
const hours = time.getHours();
|
||||||
const greeting =
|
const greeting = hours < 12 ? 'Bom dia' : hours < 18 ? 'Boa tarde' : 'Boa noite';
|
||||||
hours < 12 ? 'Bom dia' : hours < 18 ? 'Boa tarde' : 'Boa noite';
|
|
||||||
|
|
||||||
const formattedDate = time.toLocaleDateString('pt-BR', {
|
const formattedDate = time.toLocaleDateString('pt-BR', {
|
||||||
weekday: 'long',
|
weekday: 'long',
|
||||||
day: '2-digit',
|
day: '2-digit',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
});
|
});
|
||||||
const formattedTime = time.toLocaleTimeString('pt-BR');
|
const formattedTime = time.toLocaleTimeString('pt-BR');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="fixed inset-0 flex flex-col items-center justify-center text-gray-800 overflow-hidden select-none">
|
<main className="fixed inset-0 flex flex-col items-center justify-center overflow-hidden text-gray-800 select-none">
|
||||||
<section className="text-center max-w-md px-4">
|
<section className="max-w-md px-4 text-center">
|
||||||
<h1 className="text-4xl font-bold mb-2">
|
<h1 className="mb-2 text-4xl font-bold">
|
||||||
{greeting},{' '}
|
{greeting}, <span className="text-blue-600">{userAuthenticated.data.nome}</span> 👋
|
||||||
<span className="text-blue-600">{userAuthenticated.data.nome}</span>{' '}
|
</h1>
|
||||||
👋
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<p className="text-gray-600 text-sm mb-6">
|
<p className="mb-6 text-sm text-gray-600">
|
||||||
Hoje é <strong>{formattedDate}</strong>, {formattedTime}
|
Hoje é <strong>{formattedDate}</strong>, {formattedTime}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="rounded-2xl p-6">
|
<div className="rounded-2xl p-6">
|
||||||
<p className="text-gray-700 leading-relaxed">
|
<p className="leading-relaxed text-gray-700">
|
||||||
Que bom ter você de volta! 🎉
|
Que bom ter você de volta! 🎉 Aproveite o seu dia e continue alcançando seus objetivos.
|
||||||
Aproveite o seu dia e continue alcançando seus objetivos.
|
</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</section>
|
</main>
|
||||||
</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';
|
'use client';
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import {
|
|
||||||
AlertDialog,
|
|
||||||
AlertDialogCancel,
|
|
||||||
AlertDialogContent,
|
|
||||||
AlertDialogDescription,
|
|
||||||
AlertDialogFooter,
|
|
||||||
AlertDialogHeader,
|
|
||||||
AlertDialogTitle,
|
|
||||||
AlertDialogAction,
|
|
||||||
} from '@/components/ui/alert-dialog';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
InputOTP,
|
AlertDialog,
|
||||||
InputOTPGroup,
|
AlertDialogCancel,
|
||||||
InputOTPSlot,
|
AlertDialogContent,
|
||||||
} from '@/components/ui/input-otp';
|
AlertDialogDescription,
|
||||||
|
AlertDialogFooter,
|
||||||
|
AlertDialogHeader,
|
||||||
|
AlertDialogTitle,
|
||||||
|
AlertDialogAction,
|
||||||
|
} from '@/components/ui/alert-dialog';
|
||||||
|
import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';
|
||||||
|
|
||||||
interface ConfirmExclusionProps {
|
interface ConfirmExclusionProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
expectedCode: string;
|
expectedCode: string;
|
||||||
confirmText?: string;
|
confirmText?: string;
|
||||||
cancelText?: string;
|
cancelText?: string;
|
||||||
onConfirm: () => void;
|
onConfirm: () => void;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
onResendCode: () => void; // Função para reenviar o código
|
onResendCode: () => void; // Função para reenviar o código
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ConfirmExclusion({
|
export default function ConfirmExclusion({
|
||||||
isOpen,
|
isOpen,
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
expectedCode,
|
expectedCode,
|
||||||
confirmText = 'Continuar',
|
confirmText = 'Continuar',
|
||||||
cancelText = 'Cancelar',
|
cancelText = 'Cancelar',
|
||||||
onConfirm,
|
onConfirm,
|
||||||
onCancel,
|
onCancel,
|
||||||
onResendCode, // A função para reenvio do código
|
onResendCode, // A função para reenvio do código
|
||||||
}: ConfirmExclusionProps) {
|
}: ConfirmExclusionProps) {
|
||||||
const [code, setCode] = useState('');
|
const [code, setCode] = useState('');
|
||||||
const [isValid, setIsValid] = useState(false);
|
const [isValid, setIsValid] = useState(false);
|
||||||
const [isResending, setIsResending] = useState(false); // Novo estado para controle de envio do código
|
const [isResending, setIsResending] = useState(false); // Novo estado para controle de envio do código
|
||||||
|
|
||||||
const handleChange = (value: string) => {
|
const handleChange = (value: string) => {
|
||||||
setCode(value);
|
setCode(value);
|
||||||
setIsValid(value === expectedCode);
|
setIsValid(value === expectedCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleResendCode = async () => {
|
const handleResendCode = async () => {
|
||||||
setIsResending(true);
|
setIsResending(true);
|
||||||
try {
|
try {
|
||||||
await onResendCode(); // Chamando a função de reenvio
|
await onResendCode(); // Chamando a função de reenvio
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Erro ao reenviar código", error);
|
console.error('Erro ao reenviar código', error);
|
||||||
} finally {
|
} finally {
|
||||||
setIsResending(false); // Resetando o estado de envio
|
setIsResending(false); // Resetando o estado de envio
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AlertDialog open={isOpen} onOpenChange={(open) => !open && onCancel()}>
|
<AlertDialog open={isOpen} onOpenChange={(open) => !open && onCancel()}>
|
||||||
<AlertDialogContent className="max-w-lg mx-auto p-6">
|
<AlertDialogContent className="mx-auto max-w-lg p-6">
|
||||||
<AlertDialogHeader className="text-center">
|
<AlertDialogHeader className="text-center">
|
||||||
<AlertDialogTitle className="text-xl font-semibold text-center">{title}</AlertDialogTitle>
|
<AlertDialogTitle className="text-center text-xl font-semibold">{title}</AlertDialogTitle>
|
||||||
{description && (
|
{description && (
|
||||||
<AlertDialogDescription className="mt-2 text-sm text-muted-foreground text-center">
|
<AlertDialogDescription className="text-muted-foreground mt-2 text-center text-sm">
|
||||||
{description}
|
{description}
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
)}
|
)}
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
|
|
||||||
<div className="py-4 text-sm text-muted-foreground space-y-4">
|
<div className="text-muted-foreground space-y-4 py-4 text-sm">
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<InputOTP
|
<InputOTP maxLength={expectedCode.length} value={code} onChange={handleChange}>
|
||||||
maxLength={expectedCode.length}
|
<InputOTPGroup className="flex gap-4">
|
||||||
value={code}
|
{expectedCode.split('').map((_, index) => (
|
||||||
onChange={handleChange}
|
<InputOTPSlot
|
||||||
>
|
key={index}
|
||||||
<InputOTPGroup className="flex gap-4">
|
index={index}
|
||||||
{expectedCode.split('').map((_, index) => (
|
className="h-12 w-12 rounded-lg border-2 border-gray-300 text-center text-lg focus:ring-2 focus:ring-blue-500"
|
||||||
<InputOTPSlot
|
/>
|
||||||
key={index}
|
))}
|
||||||
index={index}
|
</InputOTPGroup>
|
||||||
className="w-12 h-12 text-center text-lg border-2 border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
|
</InputOTP>
|
||||||
/>
|
</div>
|
||||||
))}
|
|
||||||
</InputOTPGroup>
|
|
||||||
</InputOTP>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Botão "Reenviar Código" */}
|
{/* Botão "Reenviar Código" */}
|
||||||
<div className="flex justify-center items-center text-center gap-2 mt-4">
|
<div className="mt-4 flex items-center justify-center gap-2 text-center">
|
||||||
<AlertDialogDescription>
|
<AlertDialogDescription>Não recebeu o código?</AlertDialogDescription>
|
||||||
Não recebeu o código?
|
<button
|
||||||
</AlertDialogDescription>
|
onClick={handleResendCode}
|
||||||
<button
|
className={`cursor-pointer font-semibold text-blue-500 ${isResending ? 'cursor-not-allowed text-gray-400' : 'hover:text-blue-600'}`}
|
||||||
onClick={handleResendCode}
|
disabled={isResending} // Desabilita o botão enquanto o código está sendo reenviado
|
||||||
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>
|
||||||
{isResending ? 'Enviando...' : 'Reenviar Código'}
|
</div>
|
||||||
</button>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
<AlertDialogCancel onClick={onCancel} className="text-gray-600 hover:text-gray-800">
|
<AlertDialogCancel onClick={onCancel} className="text-gray-600 hover:text-gray-800">
|
||||||
{cancelText}
|
{cancelText}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction onClick={onConfirm} disabled={!isValid}>
|
||||||
onClick={onConfirm}
|
{confirmText}
|
||||||
disabled={!isValid}
|
</AlertDialogAction>
|
||||||
>
|
</AlertDialogFooter>
|
||||||
{confirmText}
|
</AlertDialogContent>
|
||||||
</AlertDialogAction>
|
</AlertDialog>
|
||||||
</AlertDialogFooter>
|
);
|
||||||
</AlertDialogContent>
|
|
||||||
</AlertDialog>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
interface UseConfirmExclusionOptions {
|
interface UseConfirmExclusionOptions {
|
||||||
onConfirm?: () => void;
|
onConfirm?: () => void;
|
||||||
|
|
@ -6,15 +6,19 @@ interface UseConfirmExclusionOptions {
|
||||||
expectedCode: string; // código que o usuário precisa digitar
|
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 [isOpen, setIsOpen] = useState(false);
|
||||||
const [code, setCode] = useState("");
|
const [code, setCode] = useState('');
|
||||||
const [isValid, setIsValid] = useState(false);
|
const [isValid, setIsValid] = useState(false);
|
||||||
|
|
||||||
const openDialog = useCallback(() => setIsOpen(true), []);
|
const openDialog = useCallback(() => setIsOpen(true), []);
|
||||||
const closeDialog = useCallback(() => {
|
const closeDialog = useCallback(() => {
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
setCode(""); // limpa o código quando fecha
|
setCode(''); // limpa o código quando fecha
|
||||||
setIsValid(false);
|
setIsValid(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
@ -35,7 +39,7 @@ export function useConfirmExclusion({ onConfirm, onCancel, expectedCode }: UseCo
|
||||||
setCode(value);
|
setCode(value);
|
||||||
setIsValid(value === expectedCode);
|
setIsValid(value === expectedCode);
|
||||||
},
|
},
|
||||||
[expectedCode]
|
[expectedCode],
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -3,60 +3,194 @@
|
||||||
|
|
||||||
@custom-variant dark (&:is(.dark *));
|
@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 {
|
@theme inline {
|
||||||
--color-background: var(--background);
|
--color-background: var(--background);
|
||||||
--color-foreground: var(--foreground);
|
--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: 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-sm: calc(var(--radius) - 4px);
|
||||||
--radius-md: calc(var(--radius) - 2px);
|
--radius-md: calc(var(--radius) - 2px);
|
||||||
--radius-lg: var(--radius);
|
--radius-lg: var(--radius);
|
||||||
--radius-xl: calc(var(--radius) + 4px);
|
--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-tighter: calc(var(--tracking-normal) - 0.05em);
|
||||||
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
|
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
|
||||||
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
|
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
|
||||||
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
|
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
|
||||||
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
|
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
|
||||||
--tracking-normal: var(--tracking-normal);
|
--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);
|
--spacing: var(--spacing);
|
||||||
--letter-spacing: var(--letter-spacing);
|
--letter-spacing: var(--letter-spacing);
|
||||||
--shadow-offset-y: var(--shadow-offset-y);
|
--shadow-offset-y: var(--shadow-offset-y);
|
||||||
|
|
@ -65,118 +199,6 @@
|
||||||
--shadow-blur: var(--shadow-blur);
|
--shadow-blur: var(--shadow-blur);
|
||||||
--shadow-opacity: var(--shadow-opacity);
|
--shadow-opacity: var(--shadow-opacity);
|
||||||
--color-shadow-color: var(--shadow-color);
|
--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 {
|
@layer base {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
|
||||||
import { Editor } from '@tinymce/tinymce-react';
|
import { Editor } from '@tinymce/tinymce-react';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
// 1. Define as propriedades que nosso componente vai receber
|
// 1. Define as propriedades que nosso componente vai receber
|
||||||
interface MainEditorProps {
|
interface MainEditorProps {
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import {
|
import {
|
||||||
Bot,
|
Bot,
|
||||||
Frame,
|
Frame,
|
||||||
GalleryVerticalEnd,
|
GalleryVerticalEnd,
|
||||||
House,
|
|
||||||
HouseIcon,
|
HouseIcon,
|
||||||
|
SquareMousePointer,
|
||||||
SquareTerminal,
|
SquareTerminal,
|
||||||
UsersIcon,
|
UsersIcon,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
import Image from 'next/image';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { NavMain } from '@/components/nav-main';
|
import { NavMain } from '@/components/nav-main';
|
||||||
import { NavProjects } from '@/components/nav-projects';
|
import { NavProjects } from '@/components/nav-projects';
|
||||||
|
|
@ -24,9 +25,7 @@ import {
|
||||||
SidebarMenuItem,
|
SidebarMenuItem,
|
||||||
SidebarRail,
|
SidebarRail,
|
||||||
} from '@/components/ui/sidebar';
|
} from '@/components/ui/sidebar';
|
||||||
|
|
||||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||||
import Image from 'next/image';
|
|
||||||
|
|
||||||
// This is sample data.
|
// This is sample data.
|
||||||
const data = {
|
const data = {
|
||||||
|
|
@ -44,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',
|
title: 'Pessoas',
|
||||||
url: '#',
|
url: '#',
|
||||||
icon: UsersIcon,
|
icon: UsersIcon,
|
||||||
isActive: false,
|
isActive: false,
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
title: 'Dashboard',
|
||||||
|
url: '/administrativo/pessoas/dashboard',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Físicas',
|
title: 'Físicas',
|
||||||
url: '/administrativo/pessoas/fisicas',
|
url: '/administrativo/pessoas/fisicas',
|
||||||
|
|
@ -66,6 +89,10 @@ const data = {
|
||||||
icon: HouseIcon,
|
icon: HouseIcon,
|
||||||
isActive: false,
|
isActive: false,
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
title: 'Dashboard',
|
||||||
|
url: '/administrativo/imoveis/dashboard',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Urbanos',
|
title: 'Urbanos',
|
||||||
url: '/administrativo/imoveis/urbanos',
|
url: '/administrativo/imoveis/urbanos',
|
||||||
|
|
@ -106,8 +133,8 @@ const data = {
|
||||||
url: '/administrativo/pessoas/estados-civis',
|
url: '/administrativo/pessoas/estados-civis',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Regimes/Comunhão",
|
title: 'Regimes/Comunhão',
|
||||||
url: "/administrativo/pessoas/regimes-comunhao/",
|
url: '/administrativo/pessoas/regimes-comunhao/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Tipo de Medida',
|
title: 'Tipo de Medida',
|
||||||
|
|
@ -130,12 +157,12 @@ const data = {
|
||||||
url: '/administrativo/minutas/naturezas',
|
url: '/administrativo/minutas/naturezas',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Censec/Tipo do Ato",
|
title: 'Censec/Tipo do Ato',
|
||||||
url: "/administrativo/centrais/censec/tipos-atos"
|
url: '/administrativo/centrais/censec/tipos-atos',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Censec/Qualidades",
|
title: 'Censec/Qualidades',
|
||||||
url: "/administrativo/centrais/censec/qualidades"
|
url: '/administrativo/centrais/censec/qualidades',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Censec/Centrais',
|
title: 'Censec/Centrais',
|
||||||
|
|
@ -146,14 +173,41 @@ const data = {
|
||||||
url: '/administrativo/centrais/censec/naturezas-litigios',
|
url: '/administrativo/centrais/censec/naturezas-litigios',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Serviços/Tipos",
|
title: 'Tipos/Serviços',
|
||||||
url: "/cadastros/servicos-tipo/",
|
url: '/administrativo/tipos-servicos',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Atos/Partes Tipos",
|
title: 'Atos/Partes Tipos',
|
||||||
url: "/administrativo/atos/partes-tipos",
|
url: '/administrativo/atos/partes-tipos',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Valores de Serviços',
|
||||||
|
url: '/administrativo/valores-de-servicos',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Gramatica',
|
||||||
|
url: '/administrativo/gramatica',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Cartório',
|
||||||
|
url: '/administrativo/cartorio',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Financeiro/Periodo',
|
||||||
|
url: '/administrativo/financeiro/periodos',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Financeiro/Emolumentos',
|
||||||
|
url: '/administrativo/financeiro/emolumentos',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Selos/Grupos',
|
||||||
|
url: '/administrativo/selos/grupos',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Financeiro/Cálculo Rápido',
|
||||||
|
url: '/administrativo/financeiro/calculo-rapido',
|
||||||
},
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
@ -182,16 +236,12 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
||||||
alt="Logo do site"
|
alt="Logo do site"
|
||||||
width={100}
|
width={100}
|
||||||
height={100}
|
height={100}
|
||||||
className='rounded-lg'
|
className="rounded-lg"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-0.5 leading-none">
|
<div className="flex flex-col gap-0.5 leading-none">
|
||||||
<span className="font-semibold">
|
<span className="font-semibold">Orius Tecnologia</span>
|
||||||
Orius Tecnologia
|
<span className="">25.9.1</span>
|
||||||
</span>
|
|
||||||
<span className="">
|
|
||||||
25.9.1
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuButton>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,20 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { cn } from '@/lib/utils';
|
import { useState } from 'react';
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
import z from 'zod';
|
||||||
|
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import z from 'zod';
|
import { cn } from '@/lib/utils';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
|
||||||
import GUsuarioLoginService from '@/packages/administrativo/services/GUsuario/GUsuarioLogin';
|
|
||||||
import { useForm } from 'react-hook-form';
|
|
||||||
import { useState } from 'react';
|
|
||||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from './ui/form';
|
|
||||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
|
||||||
import { Button } from './ui/button';
|
|
||||||
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
|
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
|
||||||
|
import GUsuarioLoginService from '@/packages/administrativo/services/GUsuario/GUsuarioLogin';
|
||||||
|
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||||
|
|
||||||
|
import { Button } from './ui/button';
|
||||||
|
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from './ui/form';
|
||||||
|
|
||||||
type FormValues = z.infer<typeof GUsuarioLoginSchema>;
|
type FormValues = z.infer<typeof GUsuarioLoginSchema>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,7 @@ export function NavMain({
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<SidebarGroup>
|
<SidebarGroup>
|
||||||
<SidebarGroupLabel>
|
<SidebarGroupLabel>SAAS</SidebarGroupLabel>
|
||||||
SAAS
|
|
||||||
</SidebarGroupLabel>
|
|
||||||
<SidebarMenu>
|
<SidebarMenu>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<Collapsible
|
<Collapsible
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,7 @@ export function NavProjects({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarGroup className="group-data-[collapsible=icon]:hidden">
|
<SidebarGroup className="group-data-[collapsible=icon]:hidden">
|
||||||
<SidebarGroupLabel>
|
<SidebarGroupLabel>Escrituras</SidebarGroupLabel>
|
||||||
Escrituras
|
|
||||||
</SidebarGroupLabel>
|
|
||||||
<SidebarMenu>
|
<SidebarMenu>
|
||||||
{projects.map((item) => (
|
{projects.map((item) => (
|
||||||
<SidebarMenuItem key={item.name}>
|
<SidebarMenuItem key={item.name}>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { ChevronsUpDown, LogOut, Sparkles } from 'lucide-react';
|
import { ChevronsUpDown, LogOut, Moon, Sparkles, Sun } from 'lucide-react';
|
||||||
|
import { useTheme } from 'next-themes';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
|
|
@ -17,11 +20,9 @@ import {
|
||||||
SidebarMenuItem,
|
SidebarMenuItem,
|
||||||
useSidebar,
|
useSidebar,
|
||||||
} from '@/components/ui/sidebar';
|
} from '@/components/ui/sidebar';
|
||||||
|
|
||||||
import GUsuarioAuthenticatedInterface from '@/shared/interfaces/GUsuarioAuthenticatedInterface';
|
|
||||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
|
||||||
import { useGUsuarioLogoutHook } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioLogoutHook';
|
import { useGUsuarioLogoutHook } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioLogoutHook';
|
||||||
import { use, useCallback, useState } from 'react';
|
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||||
|
import GUsuarioAuthenticatedInterface from '@/shared/interfaces/GUsuarioAuthenticatedInterface';
|
||||||
|
|
||||||
export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||||
// Hook para encerrar sessão
|
// Hook para encerrar sessão
|
||||||
|
|
@ -32,19 +33,26 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||||
|
|
||||||
const { isMobile } = useSidebar();
|
const { isMobile } = useSidebar();
|
||||||
|
|
||||||
// Manipulação de formulário de confirmação
|
// Tema (claro/escuro) - next-themes
|
||||||
const handleConfirmOpen = useCallback(async () => {
|
const { theme, setTheme } = useTheme();
|
||||||
|
const isDark = theme === 'dark';
|
||||||
|
|
||||||
|
const handleConfirmOpen = useCallback(() => {
|
||||||
setIsConfirmOpen(true);
|
setIsConfirmOpen(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleLogoutConfirm = useCallback(async () => {
|
const handleLogoutConfirm = useCallback(() => {
|
||||||
logoutUsuario();
|
logoutUsuario();
|
||||||
}, []);
|
}, [logoutUsuario]);
|
||||||
|
|
||||||
const handleLogoutCancel = useCallback(async () => {
|
const handleLogoutCancel = useCallback(() => {
|
||||||
setIsConfirmOpen(false);
|
setIsConfirmOpen(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleToggleTheme = useCallback(() => {
|
||||||
|
setTheme(isDark ? 'light' : 'dark');
|
||||||
|
}, [isDark, setTheme]);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return 'Carregando...';
|
return 'Carregando...';
|
||||||
}
|
}
|
||||||
|
|
@ -61,13 +69,11 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||||
>
|
>
|
||||||
<Avatar className="h-8 w-8 rounded-lg">
|
<Avatar className="h-8 w-8 rounded-lg">
|
||||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||||
|
|
||||||
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|
||||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||||
<span className="truncate font-medium">{user.nome}</span>
|
<span className="truncate font-medium">{user.nome}</span>
|
||||||
|
|
||||||
<span className="truncate text-xs">{user.email}</span>
|
<span className="truncate text-xs">{user.email}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -85,13 +91,11 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||||
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
||||||
<Avatar className="h-8 w-8 rounded-lg">
|
<Avatar className="h-8 w-8 rounded-lg">
|
||||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||||
|
|
||||||
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|
||||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||||
<span className="truncate font-medium">{user.nome}</span>
|
<span className="truncate font-medium">{user.nome}</span>
|
||||||
|
|
||||||
<span className="truncate text-xs">{user.email}</span>
|
<span className="truncate text-xs">{user.email}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -100,16 +104,22 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
|
|
||||||
<DropdownMenuGroup>
|
<DropdownMenuGroup>
|
||||||
|
{/* Alternância de tema */}
|
||||||
|
<DropdownMenuItem className="cursor-pointer" onClick={handleToggleTheme}>
|
||||||
|
{isDark ? <Sun className="mr-2 h-4 w-4" /> : <Moon className="mr-2 h-4 w-4" />}
|
||||||
|
{isDark ? 'Modo claro' : 'Modo escuro'}
|
||||||
|
</DropdownMenuItem>
|
||||||
|
|
||||||
<DropdownMenuItem className="cursor-pointer">
|
<DropdownMenuItem className="cursor-pointer">
|
||||||
<Sparkles />
|
<Sparkles className="mr-2 h-4 w-4" />
|
||||||
Configurações
|
Configurações
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuGroup>
|
</DropdownMenuGroup>
|
||||||
|
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
|
|
||||||
<DropdownMenuItem className="cursor-pointer" onClick={() => handleConfirmOpen()}>
|
<DropdownMenuItem className="cursor-pointer" onClick={handleConfirmOpen}>
|
||||||
<LogOut />
|
<LogOut className="mr-2 h-4 w-4" />
|
||||||
Log out
|
Log out
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
|
|
@ -122,11 +132,11 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||||
isOpen={isConfirmOpen}
|
isOpen={isConfirmOpen}
|
||||||
title="Log-out"
|
title="Log-out"
|
||||||
description="Atenção"
|
description="Atenção"
|
||||||
message={`Deseja realmente encerrar a sessão ? Dados não salvos serão perdidos`}
|
message="Deseja realmente encerrar a sessão? Dados não salvos serão perdidos."
|
||||||
confirmText="Sim, sair"
|
confirmText="Sim, sair"
|
||||||
cancelText="Cancelar"
|
cancelText="Cancelar"
|
||||||
onConfirm={() => handleLogoutConfirm()}
|
onConfirm={handleLogoutConfirm}
|
||||||
onCancel={() => handleLogoutCancel()}
|
onCancel={handleLogoutCancel}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import { ChevronsUpDown, Plus } from 'lucide-react';
|
import { ChevronsUpDown, Plus } from 'lucide-react';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
|
|
|
||||||
17
src/components/theme-provider.tsx
Normal file
17
src/components/theme-provider.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
||||||
|
return (
|
||||||
|
<NextThemesProvider
|
||||||
|
attribute="class"
|
||||||
|
defaultTheme="system"
|
||||||
|
enableSystem
|
||||||
|
disableTransitionOnChange
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</NextThemesProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
|
||||||
import { buttonVariants } from '@/components/ui/button';
|
import { buttonVariants } from '@/components/ui/button';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
||||||
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
|
|
||||||
39
src/components/ui/badge.tsx
Normal file
39
src/components/ui/badge.tsx
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
import { Slot } from '@radix-ui/react-slot';
|
||||||
|
import { cva, type VariantProps } from 'class-variance-authority';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
const badgeVariants = cva(
|
||||||
|
'inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden',
|
||||||
|
{
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
|
||||||
|
secondary:
|
||||||
|
'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
|
||||||
|
destructive:
|
||||||
|
'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
||||||
|
outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: 'default',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
function Badge({
|
||||||
|
className,
|
||||||
|
variant,
|
||||||
|
asChild = false,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
||||||
|
const Comp = asChild ? Slot : 'span';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props} />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Badge, badgeVariants };
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
|
||||||
import { Slot } from '@radix-ui/react-slot';
|
import { Slot } from '@radix-ui/react-slot';
|
||||||
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
|
|
||||||
78
src/components/ui/button-group.tsx
Normal file
78
src/components/ui/button-group.tsx
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
import { Slot } from '@radix-ui/react-slot';
|
||||||
|
import { cva, type VariantProps } from 'class-variance-authority';
|
||||||
|
|
||||||
|
import { Separator } from '@/components/ui/separator';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
const buttonGroupVariants = cva(
|
||||||
|
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
||||||
|
{
|
||||||
|
variants: {
|
||||||
|
orientation: {
|
||||||
|
horizontal:
|
||||||
|
'[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',
|
||||||
|
vertical:
|
||||||
|
'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
orientation: 'horizontal',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
function ButtonGroup({
|
||||||
|
className,
|
||||||
|
orientation,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
role="group"
|
||||||
|
data-slot="button-group"
|
||||||
|
data-orientation={orientation}
|
||||||
|
className={cn(buttonGroupVariants({ orientation }), className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ButtonGroupText({
|
||||||
|
className,
|
||||||
|
asChild = false,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'> & {
|
||||||
|
asChild?: boolean;
|
||||||
|
}) {
|
||||||
|
const Comp = asChild ? Slot : 'div';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Comp
|
||||||
|
className={cn(
|
||||||
|
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ButtonGroupSeparator({
|
||||||
|
className,
|
||||||
|
orientation = 'vertical',
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<typeof Separator>) {
|
||||||
|
return (
|
||||||
|
<Separator
|
||||||
|
data-slot="button-group-separator"
|
||||||
|
orientation={orientation}
|
||||||
|
className={cn(
|
||||||
|
'bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
|
||||||
import { Slot } from '@radix-ui/react-slot';
|
import { Slot } from '@radix-ui/react-slot';
|
||||||
import { cva, type VariantProps } from 'class-variance-authority';
|
import { cva, type VariantProps } from 'class-variance-authority';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
|
@ -9,12 +9,12 @@ const buttonVariants = cva(
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
|
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
||||||
destructive:
|
destructive:
|
||||||
'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
||||||
outline:
|
outline:
|
||||||
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
|
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
|
||||||
secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
|
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
||||||
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
||||||
link: 'text-primary underline-offset-4 hover:underline',
|
link: 'text-primary underline-offset-4 hover:underline',
|
||||||
},
|
},
|
||||||
|
|
@ -23,6 +23,8 @@ const buttonVariants = cva(
|
||||||
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
|
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
|
||||||
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
||||||
icon: 'size-9',
|
icon: 'size-9',
|
||||||
|
'icon-sm': 'size-8',
|
||||||
|
'icon-lg': 'size-10',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
||||||
<div
|
<div
|
||||||
data-slot="card-header"
|
data-slot="card-header"
|
||||||
className={cn(
|
className={cn(
|
||||||
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
132
src/components/ui/chart.tsx
Normal file
132
src/components/ui/chart.tsx
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
const ChartTooltip = RechartsPrimitive.Tooltip;
|
||||||
|
|
||||||
|
function ChartTooltipContent(props: any) {
|
||||||
|
const {
|
||||||
|
active,
|
||||||
|
payload,
|
||||||
|
className,
|
||||||
|
indicator = 'dot',
|
||||||
|
hideLabel = false,
|
||||||
|
hideIndicator = false,
|
||||||
|
label,
|
||||||
|
labelFormatter,
|
||||||
|
labelClassName,
|
||||||
|
formatter,
|
||||||
|
color,
|
||||||
|
nameKey,
|
||||||
|
labelKey,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const { config } = useChart();
|
||||||
|
|
||||||
|
const tooltipLabel = React.useMemo(() => {
|
||||||
|
if (hideLabel || !payload?.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [item] = payload;
|
||||||
|
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
|
||||||
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
||||||
|
const value =
|
||||||
|
!labelKey && typeof label === 'string'
|
||||||
|
? config[label as keyof typeof config]?.label || label
|
||||||
|
: itemConfig?.label;
|
||||||
|
|
||||||
|
if (labelFormatter) {
|
||||||
|
return (
|
||||||
|
<div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <div className={cn('font-medium', labelClassName)}>{value}</div>;
|
||||||
|
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
||||||
|
|
||||||
|
if (!active || !payload?.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{!nestLabel ? tooltipLabel : null}
|
||||||
|
<div className="grid gap-1.5">
|
||||||
|
{payload
|
||||||
|
.filter((item: any) => item.type !== 'none')
|
||||||
|
.map((item: any, index: number) => {
|
||||||
|
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
||||||
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
||||||
|
const indicatorColor = color || item.payload?.fill || item.color;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={item.dataKey}
|
||||||
|
className={cn(
|
||||||
|
'[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',
|
||||||
|
indicator === 'dot' && 'items-center',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{formatter && item?.value !== undefined && item.name ? (
|
||||||
|
formatter(item.value, item.name, item, index, item.payload)
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{itemConfig?.icon ? (
|
||||||
|
<itemConfig.icon />
|
||||||
|
) : (
|
||||||
|
!hideIndicator && (
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',
|
||||||
|
{
|
||||||
|
'h-2.5 w-2.5': indicator === 'dot',
|
||||||
|
'w-1': indicator === 'line',
|
||||||
|
'w-0 border-[1.5px] border-dashed bg-transparent':
|
||||||
|
indicator === 'dashed',
|
||||||
|
'my-0.5': nestLabel && indicator === 'dashed',
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
'--color-bg': indicatorColor,
|
||||||
|
'--color-border': indicatorColor,
|
||||||
|
} as React.CSSProperties
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
'flex flex-1 justify-between leading-none',
|
||||||
|
nestLabel ? 'items-end' : 'items-center',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="grid gap-1.5">
|
||||||
|
{nestLabel ? tooltipLabel : null}
|
||||||
|
<span className="text-muted-foreground">
|
||||||
|
{itemConfig?.label || item.name}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{item.value && (
|
||||||
|
<span className="text-foreground font-mono font-medium tabular-nums">
|
||||||
|
{item.value.toLocaleString()}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
||||||
import { CheckIcon } from 'lucide-react';
|
import { CheckIcon } from 'lucide-react';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import { Command as CommandPrimitive } from 'cmdk';
|
import { Command as CommandPrimitive } from 'cmdk';
|
||||||
import { SearchIcon } from 'lucide-react';
|
import { SearchIcon } from 'lucide-react';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
|
|
@ -12,6 +11,7 @@ import {
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||||
import { XIcon } from 'lucide-react';
|
import { XIcon } from 'lucide-react';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
||||||
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import * as LabelPrimitive from '@radix-ui/react-label';
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
||||||
import { Slot } from '@radix-ui/react-slot';
|
import { Slot } from '@radix-ui/react-slot';
|
||||||
|
import * as React from 'react';
|
||||||
import {
|
import {
|
||||||
Controller,
|
Controller,
|
||||||
FormProvider,
|
FormProvider,
|
||||||
|
|
@ -13,8 +13,8 @@ import {
|
||||||
type FieldValues,
|
type FieldValues,
|
||||||
} from 'react-hook-form';
|
} from 'react-hook-form';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
const Form = FormProvider;
|
const Form = FormProvider;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,51 @@
|
||||||
"use client"
|
'use client';
|
||||||
|
|
||||||
import * as React from "react"
|
import { OTPInput, OTPInputContext } from 'input-otp';
|
||||||
import { OTPInput, OTPInputContext } from "input-otp"
|
import { MinusIcon } from 'lucide-react';
|
||||||
import { MinusIcon } from "lucide-react"
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
function InputOTP({
|
function InputOTP({
|
||||||
className,
|
className,
|
||||||
containerClassName,
|
containerClassName,
|
||||||
...props
|
...props
|
||||||
}: React.ComponentProps<typeof OTPInput> & {
|
}: React.ComponentProps<typeof OTPInput> & {
|
||||||
containerClassName?: string
|
containerClassName?: string;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<OTPInput
|
<OTPInput
|
||||||
data-slot="input-otp"
|
data-slot="input-otp"
|
||||||
containerClassName={cn(
|
containerClassName={cn('flex items-center gap-2 has-disabled:opacity-50', containerClassName)}
|
||||||
"flex items-center gap-2 has-disabled:opacity-50",
|
className={cn('disabled:cursor-not-allowed', className)}
|
||||||
containerClassName
|
|
||||||
)}
|
|
||||||
className={cn("disabled:cursor-not-allowed", className)}
|
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
|
function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div data-slot="input-otp-group" className={cn('flex items-center', className)} {...props} />
|
||||||
data-slot="input-otp-group"
|
);
|
||||||
className={cn("flex items-center", className)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function InputOTPSlot({
|
function InputOTPSlot({
|
||||||
index,
|
index,
|
||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
}: React.ComponentProps<"div"> & {
|
}: React.ComponentProps<'div'> & {
|
||||||
index: number
|
index: number;
|
||||||
}) {
|
}) {
|
||||||
const inputOTPContext = React.useContext(OTPInputContext)
|
const inputOTPContext = React.useContext(OTPInputContext);
|
||||||
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-slot="input-otp-slot"
|
data-slot="input-otp-slot"
|
||||||
data-active={isActive}
|
data-active={isActive}
|
||||||
className={cn(
|
className={cn(
|
||||||
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
'data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]',
|
||||||
className
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
|
|
@ -63,15 +56,15 @@ function InputOTPSlot({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {
|
||||||
return (
|
return (
|
||||||
<div data-slot="input-otp-separator" role="separator" {...props}>
|
<div data-slot="input-otp-separator" role="separator" {...props}>
|
||||||
<MinusIcon />
|
<MinusIcon />
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,17 @@ import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
function Input({ className, value, type, ...props }: React.ComponentProps<'input'>) {
|
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
||||||
return (
|
return (
|
||||||
<input
|
<input
|
||||||
type={type}
|
type={type}
|
||||||
data-slot="input"
|
data-slot="input"
|
||||||
className={cn(
|
className={cn(
|
||||||
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
||||||
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
||||||
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
value={value ?? ''}
|
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue