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">
|
<div className="grid grid-cols-4 items-center gap-4">
|
||||||
<Label className="text-right">Endereço</Label>
|
<Label className="text-right">Endereço</Label>
|
||||||
<span className="col-span-3">
|
<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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-4 items-center gap-4">
|
<div className="grid grid-cols-4 items-center gap-4">
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useRouter } from "next/navigation";
|
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 HeaderAgenda from "@/components/agenda/HeaderAgenda";
|
||||||
import FooterAgenda from "@/components/agenda/FooterAgenda";
|
import FooterAgenda from "@/components/agenda/FooterAgenda";
|
||||||
|
|
||||||
@ -10,23 +10,22 @@ export default function NovoAgendamentoPage() {
|
|||||||
|
|
||||||
const handleSave = (data: any) => {
|
const handleSave = (data: any) => {
|
||||||
console.log("Salvando novo agendamento...", data);
|
console.log("Salvando novo agendamento...", data);
|
||||||
// Aqui viria a chamada da API para criar um novo agendamento
|
|
||||||
alert("Novo agendamento salvo (simulado)!");
|
alert("Novo agendamento salvo (simulado)!");
|
||||||
router.push("/consultas"); // Volta para a lista após salvar
|
router.push("/consultas");
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
router.back(); // Simplesmente volta para a página anterior
|
router.back();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen flex flex-col bg-white">
|
<div className="min-h-screen flex flex-col bg-white">
|
||||||
<HeaderAgenda />
|
<HeaderAgenda />
|
||||||
<main className="flex-1 mx-auto w-full max-w-7xl px-8 py-8">
|
<main className="flex-1 mx-auto w-full max-w-7xl px-8 py-8">
|
||||||
<AppointmentForm
|
<CalendarRegistrationForm
|
||||||
onSave={handleSave}
|
onSave={handleSave}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
initialData={{}} // Passa um objeto vazio para o modo de criação
|
initialData={{}}
|
||||||
/>
|
/>
|
||||||
</main>
|
</main>
|
||||||
<FooterAgenda />
|
<FooterAgenda />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user