diff --git a/susconecta/app/(main-routes)/doutores/page.tsx b/susconecta/app/(main-routes)/doutores/page.tsx index c034860..64fcf5e 100644 --- a/susconecta/app/(main-routes)/doutores/page.tsx +++ b/susconecta/app/(main-routes)/doutores/page.tsx @@ -326,10 +326,11 @@ export default function DoutoresPage() { onKeyDown={handleSearchKeyDown} /> - diff --git a/susconecta/app/(main-routes)/pacientes/page.tsx b/susconecta/app/(main-routes)/pacientes/page.tsx index 9310a62..6b8193a 100644 --- a/susconecta/app/(main-routes)/pacientes/page.tsx +++ b/susconecta/app/(main-routes)/pacientes/page.tsx @@ -204,7 +204,7 @@ export default function PacientesPage() { onKeyDown={(e) => e.key === "Enter" && handleBuscarServidor()} /> - + - - ) -} diff --git a/susconecta/app/agenda/page.tsx b/susconecta/app/agenda/page.tsx index 36cc1cc..fff1a81 100644 --- a/susconecta/app/agenda/page.tsx +++ b/susconecta/app/agenda/page.tsx @@ -4,18 +4,46 @@ import { useRouter } from "next/navigation"; import { CalendarRegistrationForm } from "@/components/forms/calendar-registration-form"; import HeaderAgenda from "@/components/agenda/HeaderAgenda"; import FooterAgenda from "@/components/agenda/FooterAgenda"; +import { useState } from "react"; + +interface FormData { + patientName?: string; + cpf?: string; + rg?: string; + birthDate?: string; + phoneCode?: string; + phoneNumber?: string; + email?: string; + convenio?: string; + matricula?: string; + validade?: string; + documentos?: string; + professionalName?: string; + unit?: string; + appointmentDate?: string; + startTime?: string; + endTime?: string; + requestingProfessional?: string; + appointmentType?: string; + notes?: string; +} export default function NovoAgendamentoPage() { const router = useRouter(); + const [formData, setFormData] = useState({}); - const handleSave = (data: any) => { - console.log("Salvando novo agendamento...", data); + const handleFormChange = (data: FormData) => { + setFormData(data); + }; + + const handleSave = () => { + console.log("Salvando novo agendamento...", formData); alert("Novo agendamento salvo (simulado)!"); router.push("/consultas"); }; const handleCancel = () => { - router.back(); + router.push("/calendar"); }; return ( @@ -23,12 +51,11 @@ export default function NovoAgendamentoPage() {
- + ); } \ No newline at end of file diff --git a/susconecta/app/financeiro/page.tsx b/susconecta/app/financeiro/page.tsx index bb14865..7981f4b 100644 --- a/susconecta/app/financeiro/page.tsx +++ b/susconecta/app/financeiro/page.tsx @@ -21,6 +21,15 @@ export default function FinanceiroPage() { const isPr = pathname?.startsWith("/procedimento"); const isFi = pathname?.startsWith("/financeiro"); + const handleSave = () => { + // Lógica de salvar será implementada + console.log("Salvando informações financeiras..."); + }; + + const handleCancel = () => { + router.push("/calendar"); + }; + return (
{/* HEADER */} @@ -53,7 +62,7 @@ export default function FinanceiroPage() {
@@ -63,7 +72,7 @@ export default function FinanceiroPage() { @@ -81,7 +90,7 @@ export default function FinanceiroPage() {
- @@ -91,7 +100,7 @@ export default function FinanceiroPage() {
- @@ -106,7 +115,7 @@ export default function FinanceiroPage() {
@@ -142,7 +151,7 @@ export default function FinanceiroPage() { {/* RODAPÉ FIXO */} - + ); } \ No newline at end of file diff --git a/susconecta/app/procedimento/page.tsx b/susconecta/app/procedimento/page.tsx index e23320e..113853a 100644 --- a/susconecta/app/procedimento/page.tsx +++ b/susconecta/app/procedimento/page.tsx @@ -20,6 +20,16 @@ export default function ProcedimentoPage() { const isAg = pathname?.startsWith("/agendamento"); const isPr = pathname?.startsWith("/procedimento"); const isFi = pathname?.startsWith("/financeiro"); + + const handleSave = () => { + // Lógica de salvar será implementada + console.log("Salvando procedimentos..."); + }; + + const handleCancel = () => { + router.push("/calendar"); + }; + const tab = (active: boolean, extra = "") => `px-4 py-1.5 text-[13px] border ${ active @@ -83,7 +93,7 @@ export default function ProcedimentoPage() { {/* RODAPÉ FIXO */} - + ); } diff --git a/susconecta/components/agenda/FooterAgenda.tsx b/susconecta/components/agenda/FooterAgenda.tsx index 91f73f9..37a6fa6 100644 --- a/susconecta/components/agenda/FooterAgenda.tsx +++ b/susconecta/components/agenda/FooterAgenda.tsx @@ -5,9 +5,13 @@ import { Button } from "../ui/button"; import { Label } from "../ui/label"; import { Switch } from "../ui/switch"; import { useState } from "react"; -import Link from "next/link"; -export default function FooterAgenda() { +interface FooterAgendaProps { + onSave: () => void; + onCancel: () => void; +} + +export default function FooterAgenda({ onSave, onCancel }: FooterAgendaProps) { const [bloqueio, setBloqueio] = useState(false); return ( @@ -18,15 +22,8 @@ export default function FooterAgenda() {
- - - - - - + +
diff --git a/susconecta/components/agenda/HeaderAgenda.tsx b/susconecta/components/agenda/HeaderAgenda.tsx index 829dfc9..928976d 100644 --- a/susconecta/components/agenda/HeaderAgenda.tsx +++ b/susconecta/components/agenda/HeaderAgenda.tsx @@ -8,17 +8,10 @@ export default function HeaderAgenda() { const pathname = usePathname(); const router = useRouter(); - const isAg = pathname?.startsWith("/agendamento"); + const isAg = pathname?.startsWith("/agenda"); const isPr = pathname?.startsWith("/procedimento"); const isFi = pathname?.startsWith("/financeiro"); - const tabCls = (active: boolean, extra = "") => - `px-4 py-1.5 text-[13px] border ${ - active - ? "border-blue-500 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium" - : "text-muted-foreground hover:bg-muted border-border" - } ${extra}`; - return (
@@ -33,24 +26,33 @@ export default function HeaderAgenda() { Agendamento Procedimento Financeiro @@ -58,9 +60,9 @@ export default function HeaderAgenda() { diff --git a/susconecta/components/dashboard/header.tsx b/susconecta/components/dashboard/header.tsx index 9942a60..5e23a67 100644 --- a/susconecta/components/dashboard/header.tsx +++ b/susconecta/components/dashboard/header.tsx @@ -35,7 +35,7 @@ export function PagesHeader({ title = "", subtitle = "" }: { title?: string, sub

{title}

-

{subtitle}

+

{subtitle}

@@ -49,42 +49,42 @@ export function PagesHeader({ title = "", subtitle = "" }: { title?: string, sub
{/* Dropdown Content */} {dropdownOpen && ( -
-
+
+

{user?.userType === 'administrador' ? 'Administrador da Clínica' : 'Usuário do Sistema'}

{user?.email ? ( -

{user.email}

+

{user.email}

) : ( -

Email não disponível

+

Email não disponível

)} -

+

Tipo: {user?.userType === 'administrador' ? 'Administrador' : user?.userType || 'Não definido'}

- - -
+
diff --git a/susconecta/components/forms/appointment-form.tsx b/susconecta/components/forms/appointment-form.tsx deleted file mode 100644 index 7898151..0000000 --- a/susconecta/components/forms/appointment-form.tsx +++ /dev/null @@ -1 +0,0 @@ -export { default } from '@/app/agenda/appointment-form'; diff --git a/susconecta/components/forms/calendar-registration-form.tsx b/susconecta/components/forms/calendar-registration-form.tsx index c06185f..5a6c21c 100644 --- a/susconecta/components/forms/calendar-registration-form.tsx +++ b/susconecta/components/forms/calendar-registration-form.tsx @@ -1,136 +1,247 @@ + "use client"; -import { useState, useEffect } from "react"; -import { Button } from "@/components/ui/button"; +import { useState } from "react"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; -import { Calendar, Search, ChevronDown, Upload, FileDown, Tag } from "lucide-react"; +import { Calendar, Search, ChevronDown } from "lucide-react"; -export function CalendarRegistrationForm({ initialData, onSave, onCancel }: any) { - const [formData, setFormData] = useState(initialData || {}); +interface FormData { + patientName?: string; + cpf?: string; + rg?: string; + birthDate?: string; + phoneCode?: string; + phoneNumber?: string; + email?: string; + convenio?: string; + matricula?: string; + validade?: string; + documentos?: string; + professionalName?: string; + unit?: string; + appointmentDate?: string; + startTime?: string; + endTime?: string; + requestingProfessional?: string; + appointmentType?: string; + notes?: string; +} - useEffect(() => { - setFormData(initialData || {}); - }, [initialData]); +interface CalendarRegistrationFormProperties { + formData: FormData; + onFormChange: (data: FormData) => void; +} - const handleChange = (e: React.ChangeEvent) => { - const { name, value } = e.target; - setFormData((prev: any) => ({ ...prev, [name]: value })); - }; +const formatValidityDate = (value: string) => { + const cleaned = value.replaceAll(/\D/g, ""); + if (cleaned.length > 4) { + return `${cleaned.slice(0, 2)}/${cleaned.slice(2, 4)}/${cleaned.slice(4, 8)}`; + } + if (cleaned.length > 2) { + return `${cleaned.slice(0, 2)}/${cleaned.slice(2, 4)}`; + } + return cleaned; +}; - const handleSubmit = (e: React.FormEvent) => { - e.preventDefault(); - onSave(formData); +export function CalendarRegistrationForm({ formData, onFormChange }: CalendarRegistrationFormProperties) { + const [isAdditionalInfoOpen, setIsAdditionalInfoOpen] = useState(false); + + const handleChange = (event: React.ChangeEvent) => { + const { name, value } = event.target; + + if (name === 'validade') { + const formattedValue = formatValidityDate(value); + onFormChange({ ...formData, [name]: formattedValue }); + } else { + onFormChange({ ...formData, [name]: value }); + } }; return ( -
+

Informações do paciente

-
- +
+
-
- - +
+ +
-
- - +
+ +
-
- - +
+ +
-
- +
+
- - +
-
- - +
+ + +
+
+ +
+ + +
+
+
+
+
+ + +
+
+ + +
+
+
+
+
setIsAdditionalInfoOpen(!isAdditionalInfoOpen)} + > +
+ + +
+
+ {isAdditionalInfoOpen && ( +
+
+ + +
+
+ )}
- {}

Informações do atendimento

-
+
- +
-
+
-
-
+
- +
-
-
+
+
- +
-
+
- + +
+
+ +
+ + + +
-
- +
+
+ +
+ + +
+
- +
-
- -