From ae7868e8e107f68b80bc6e126e033e7a1f178ce2 Mon Sep 17 00:00:00 2001 From: daniel-barbosaa Date: Mon, 10 Nov 2025 19:32:17 -0300 Subject: [PATCH 1/2] feat(forwarded): creation of the basic layout --- .../encaminhados/encaminhamentos/page.tsx | 8 ++++++ src/app/(dashboard)/encaminhados/layout.tsx | 28 +++++++++++++++++++ src/app/(dashboard)/encaminhados/page.tsx | 8 +----- src/constants/routes.ts | 1 + 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx create mode 100644 src/app/(dashboard)/encaminhados/layout.tsx diff --git a/src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx b/src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx new file mode 100644 index 0000000..e9cec52 --- /dev/null +++ b/src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx @@ -0,0 +1,8 @@ +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Encaminhamentos', +} +export default function Page() { + return

Encaminhamentos

+} diff --git a/src/app/(dashboard)/encaminhados/layout.tsx b/src/app/(dashboard)/encaminhados/layout.tsx new file mode 100644 index 0000000..a1592b9 --- /dev/null +++ b/src/app/(dashboard)/encaminhados/layout.tsx @@ -0,0 +1,28 @@ +import { DashboardContainer } from '@/components/dashboard/container' +import { DashboardTabButtons } from '@/components/dashboard/tab-buttons' +import { ROUTES } from '@/constants/routes' + +export default function Layout({ + children, +}: Readonly<{ children: React.ReactNode }>) { + const tabButtons = [ + { + title: 'Dados Gerais', + path: ROUTES.dashboard.forwarded.main, + }, + { + title: 'Encaminhamentos', + path: ROUTES.dashboard.forwarded.referrals, + }, + ] + + return ( + <> + + + + {children} + + + ) +} diff --git a/src/app/(dashboard)/encaminhados/page.tsx b/src/app/(dashboard)/encaminhados/page.tsx index c2ed60e..b85d538 100644 --- a/src/app/(dashboard)/encaminhados/page.tsx +++ b/src/app/(dashboard)/encaminhados/page.tsx @@ -4,12 +4,6 @@ export const metadata: Metadata = { title: 'Encaminhados', } -import { DashboardContainer } from '@/components/dashboard/container' - export default function Page() { - return ( - - Encaminhados - - ) + return

Dados Gerais

} diff --git a/src/constants/routes.ts b/src/constants/routes.ts index 30aec97..e9dcc51 100644 --- a/src/constants/routes.ts +++ b/src/constants/routes.ts @@ -30,6 +30,7 @@ export const ROUTES = { }, forwarded: { main: '/encaminhados', + referrals: '/encaminhados/encaminhamentos', }, approvals: { main: '/aprovacoes', From 84237f7d11a8b2fe2f61e80158dfc36b1ecff6f3 Mon Sep 17 00:00:00 2001 From: daniel-barbosaa Date: Mon, 17 Nov 2025 20:01:14 -0300 Subject: [PATCH 2/2] feat(referrals-screen): finalized referrals screen --- .../encaminhados/encaminhamentos/page.tsx | 5 +- .../encaminhamentos/referrals-skeleton.tsx | 35 +++ .../encaminhamentos/referrals-table.tsx | 205 ++++++++++++++++++ src/types/patients.ts | 16 ++ 4 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 src/app/(dashboard)/encaminhados/encaminhamentos/referrals-skeleton.tsx create mode 100644 src/app/(dashboard)/encaminhados/encaminhamentos/referrals-table.tsx diff --git a/src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx b/src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx index e9cec52..ec02309 100644 --- a/src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx +++ b/src/app/(dashboard)/encaminhados/encaminhamentos/page.tsx @@ -1,8 +1,11 @@ import type { Metadata } from 'next' +import { ReferralsTable } from './referrals-table' + export const metadata: Metadata = { title: 'Encaminhamentos', } + export default function Page() { - return

Encaminhamentos

+ return } diff --git a/src/app/(dashboard)/encaminhados/encaminhamentos/referrals-skeleton.tsx b/src/app/(dashboard)/encaminhados/encaminhamentos/referrals-skeleton.tsx new file mode 100644 index 0000000..348ad8b --- /dev/null +++ b/src/app/(dashboard)/encaminhados/encaminhamentos/referrals-skeleton.tsx @@ -0,0 +1,35 @@ +import { Skeleton } from '@/components/ui/skeleton' +import { TableBody, TableCell, TableRow } from '@/components/ui/table' + +export default function ReferralsSkeleton() { + const skeletons = Array.from({ length: 10 }).map((_, index) => index) + + return ( + + {skeletons.map((skeleton) => ( + + +
+ +
+
+ + + + + + + + + + + + + + + +
+ ))} +
+ ) +} diff --git a/src/app/(dashboard)/encaminhados/encaminhamentos/referrals-table.tsx b/src/app/(dashboard)/encaminhados/encaminhamentos/referrals-table.tsx new file mode 100644 index 0000000..a302524 --- /dev/null +++ b/src/app/(dashboard)/encaminhados/encaminhamentos/referrals-table.tsx @@ -0,0 +1,205 @@ +'use client' +import { Eye } from 'lucide-react' +import { useState } from 'react' + +import { DataTableHeader } from '@/components/data-table/header' +import { DataTableHeaderActions } from '@/components/data-table/header/actions' +import { DataTableHeaderOrderBy } from '@/components/data-table/header/order-by' +import { DataTableHeaderSearch } from '@/components/data-table/header/search' +import { Pagination } from '@/components/pagination' +import { AppointmentConditionTag } from '@/components/tags/appointment-condition' +import { Card } from '@/components/ui/card' +import { TabSelect } from '@/components/ui/tab-select' +import { + Table, + TableBody, + TableButton, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '@/components/ui/table' +import { + PatientConditionType, + PATIENTS_REFERRALS_ORDER_OPTIONS, +} from '@/types/patients' + +import ReferralsSkeleton from './referrals-skeleton' + +const referrals = [ + { + id: 1, + nome: 'Ana Silva', + encaminhadoEm: '03/03/2025', + profissional: 'João Pereira', + especialidade: 'Medicina', + quadroGeral: 'stable', + }, + { + id: 2, + nome: 'Carlos Mendes', + encaminhadoEm: '03/03/2025', + profissional: 'Mariana Costa', + especialidade: 'Psicologia', + quadroGeral: 'outbreak', + }, + { + id: 3, + nome: 'Beatriz Rocha', + encaminhadoEm: '03/03/2025', + profissional: 'Lucas Andrade', + especialidade: 'Nutrição', + quadroGeral: 'stable', + }, + { + id: 4, + nome: 'Rafael Gomes', + encaminhadoEm: '03/03/2025', + profissional: 'Fernanda Lima', + especialidade: 'Enfermagem', + quadroGeral: 'outbreak', + }, + { + id: 5, + nome: 'Juliana Santos', + encaminhadoEm: '03/03/2025', + profissional: 'Pedro Albuquerque', + especialidade: 'Advocacia', + quadroGeral: 'stable', + }, + { + id: 6, + nome: 'Marcos Oliveira', + encaminhadoEm: '03/03/2025', + profissional: 'Camila Duarte', + especialidade: 'Medicina', + quadroGeral: 'stable', + }, + { + id: 7, + nome: 'Paula Ferreira', + encaminhadoEm: '03/03/2025', + profissional: 'Ricardo Matos', + especialidade: 'Psicologia', + quadroGeral: 'outbreak', + }, + { + id: 8, + nome: 'Daniel Azevedo', + encaminhadoEm: '03/03/2025', + profissional: 'Larissa Pires', + especialidade: 'Nutrição', + quadroGeral: 'stable', + }, + { + id: 9, + nome: 'Gabriela Martins', + encaminhadoEm: '03/03/2025', + profissional: 'Diego Amaral', + especialidade: 'Enfermagem', + quadroGeral: 'outbreak', + }, + { + id: 10, + nome: 'Vitor Souza', + encaminhadoEm: '03/03/2025', + profissional: 'Letícia Moura', + especialidade: 'Psicologia', + quadroGeral: 'stable', + }, +] + +export function ReferralsTable() { + const [isLoading] = useState(false) + const [isReferralsEmpty] = useState(referrals.length <= 0) + const [statusFilter, setStatusFilter] = useState('all') + + const filterOptions = [ + { + label: 'Todos', + isActive: statusFilter === 'all', + onClick: () => setStatusFilter('all'), + }, + { + label: 'Em surto', + isActive: statusFilter === 'outbreak', + onClick: () => setStatusFilter('outbreak'), + }, + { + label: 'Estável', + isActive: statusFilter === 'stable', + onClick: () => setStatusFilter('stable'), + }, + ] + + return ( +
+ + + + + + + + + + + + + Nome do paciente + Encaminhado em + Profissional + Especialidade + Quadro geral + Observações + + + + {isLoading && } + + {!isLoading && isReferralsEmpty && ( + + + +
+ Nenhum paciente encontrado +
+
+
+
+ )} + + {!isLoading && !isReferralsEmpty && ( + + {referrals?.map((forwarding) => ( + + {forwarding.nome} + + {forwarding.encaminhadoEm} + {forwarding.profissional} + + + {forwarding.especialidade} + + + + + + + + + + + + ))} + + )} +
+
+ + +
+ ) +} diff --git a/src/types/patients.ts b/src/types/patients.ts index c0d23cc..fb07342 100644 --- a/src/types/patients.ts +++ b/src/types/patients.ts @@ -70,9 +70,25 @@ export const PATIENTS_ORDER = { email_asc: 'E-mail (Crescente)', email_desc: 'E-mail (Decrescente)', } + export type PatientsOrderType = keyof typeof PATIENTS_ORDER export const PATIENTS_ORDER_OPTIONS = convertObjectToOptions(PATIENTS_ORDER) +export const PATIENT_REFERRALS_ORDER = { + name_asc: 'Nome (Crescente)', + name_desc: 'Nome (Decrescente)', + date_asc: 'Data (Crescente)', + date_desc: 'Data (Decrescente)', + general_overview_asc: 'Em surto (Crescente)', + general_overview_desc: 'Estável (Decrescente)', +} + +export type PatientsReferralsOrderType = keyof typeof PATIENT_REFERRALS_ORDER + +export const PATIENTS_REFERRALS_ORDER_OPTIONS = convertObjectToOptions( + PATIENT_REFERRALS_ORDER, +) + export const PATIENT_CONDITIONS = { outbreak: 'Em surto', stable: 'Estável',