forked from RiseUP/riseup-squad20
fix(pages): Fix imports and type errors in agenda and patients - Fixes the form import in the scheduling page. - Adds optional chaining (?.) for safe accessto the patient's address.
This commit is contained in:
parent
5030ae38d0
commit
956a8ff016
@ -276,7 +276,7 @@ export default function PacientesPage() {
|
||||
<div className="grid grid-cols-4 items-center gap-4">
|
||||
<Label className="text-right">Endereço</Label>
|
||||
<span className="col-span-3">
|
||||
{`${viewingPatient.endereco.logradouro}, ${viewingPatient.endereco.numero} - ${viewingPatient.endereco.bairro}, ${viewingPatient.endereco.cidade} - ${viewingPatient.endereco.estado}`}
|
||||
{`${viewingPatient.endereco?.logradouro || ''}, ${viewingPatient.endereco?.numero || ''} - ${viewingPatient.endereco?.bairro || ''}, ${viewingPatient.endereco?.cidade || ''} - ${viewingPatient.endereco?.estado || ''}`}
|
||||
</span>
|
||||
</div>
|
||||
<div className="grid grid-cols-4 items-center gap-4">
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import { AppointmentForm } from "@/components/forms/appointment-form";
|
||||
import { CalendarRegistrationForm } from "@/components/forms/calendar-registration-form";
|
||||
import HeaderAgenda from "@/components/agenda/HeaderAgenda";
|
||||
import FooterAgenda from "@/components/agenda/FooterAgenda";
|
||||
|
||||
@ -10,23 +10,22 @@ export default function NovoAgendamentoPage() {
|
||||
|
||||
const handleSave = (data: any) => {
|
||||
console.log("Salvando novo agendamento...", data);
|
||||
// Aqui viria a chamada da API para criar um novo agendamento
|
||||
alert("Novo agendamento salvo (simulado)!");
|
||||
router.push("/consultas"); // Volta para a lista após salvar
|
||||
router.push("/consultas");
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
router.back(); // Simplesmente volta para a página anterior
|
||||
router.back();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col bg-white">
|
||||
<HeaderAgenda />
|
||||
<main className="flex-1 mx-auto w-full max-w-7xl px-8 py-8">
|
||||
<AppointmentForm
|
||||
<CalendarRegistrationForm
|
||||
onSave={handleSave}
|
||||
onCancel={handleCancel}
|
||||
initialData={{}} // Passa um objeto vazio para o modo de criação
|
||||
initialData={{}}
|
||||
/>
|
||||
</main>
|
||||
<FooterAgenda />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user