Merge pull request 'main' (#16) from StsDanilo/riseup-squad21:main into main

Reviewed-on: #16
This commit is contained in:
LiraS2 2025-10-02 19:55:38 +00:00
commit 1db117d84c
7 changed files with 155 additions and 122 deletions

View File

@ -10,7 +10,7 @@ export default function HomePage() {
<div className="text-center mb-12">
<h1 className="text-4xl font-bold text-gray-900 mb-4">Central de Operações <br>
</br>
MidConnecta
MedConnect
</h1>
<p className="text-xl text-gray-600 max-w-2xl mx-auto">

View File

@ -10,12 +10,12 @@ export default function InicialPage() {
{}
<div className="bg-black text-white text-sm py-2 px-6 flex justify-between">
<span> Horário: 08h00 - 21h00</span>
<span> Email: contato@midconnecta.com</span>
<span> Email: contato@medconnect.com</span>
</div>
{}
<header className="bg-white shadow-md py-4 px-6 flex justify-between items-center">
<h1 className="text-2xl font-bold text-blue-700">MidConnecta</h1>
<h1 className="text-2xl font-bold text-blue-700">MedConnect</h1>
<nav className="flex space-x-6 text-gray-700 font-medium">
<a href="#home" className="hover:text-blue-600">Home</a>
<a href="#about" className="hover:text-blue-600">Sobre</a>
@ -106,7 +106,7 @@ export default function InicialPage() {
{}
<footer className="bg-black text-white py-6 text-center">
<p>© 2025 MidConnecta</p>
<p>© 2025 MedConnect</p>
</footer>
</div>
);

View File

@ -8,7 +8,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
import { Plus, Edit, Trash2, Eye, Calendar, Filter } from "lucide-react";
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog";
import SecretaryLayout from "@/components/secretary-layout";
import { patientsService } from "@/services/patientsApi.mjs"
import { patientsService } from "@/services/patientsApi.mjs";
export default function PacientesPage() {
const [searchTerm, setSearchTerm] = useState("");
@ -58,12 +58,12 @@ export default function PacientesPage() {
setPatients((prev) => {
const all = [...prev, ...mapped];
const unique = Array.from(new Map(all.map(p => [p.id, p])).values());
const unique = Array.from(new Map(all.map((p) => [p.id, p])).values());
return unique;
});
if (mapped.length === 0) setHasNext(false); // parar carregamento
else setPage(prev => prev + 1);
if (!mapped.id) setHasNext(false); // parar carregamento
else setPage((prev) => prev + 1);
} catch (e: any) {
setError(e?.message || "Erro ao buscar pacientes");
} finally {
@ -97,12 +97,10 @@ export default function PacientesPage() {
const res = await patientsService.delete(patientId);
if (res) {
alert(`${res.error} ${res.message}`)
alert(`${res.error} ${res.message}`);
}
setPatients((prev) => prev.filter((p) => String(p.id) !== String(patientId)));
} catch (e: any) {
setError(e?.message || "Erro ao deletar paciente");
}
@ -217,7 +215,6 @@ export default function PacientesPage() {
<Filter className="w-4 h-4 mr-2" />
Filtro avançado
</Button>
</div>
<div className="bg-white rounded-lg border border-gray-200">
@ -325,24 +322,62 @@ export default function PacientesPage() {
<div className="text-red-600">{patientDetails.error}</div>
) : (
<div className="space-y-2 text-left">
<p><strong>Nome:</strong> {patientDetails.full_name}</p>
<p><strong>CPF:</strong> {patientDetails.cpf}</p>
<p><strong>Email:</strong> {patientDetails.email}</p>
<p><strong>Telefone:</strong> {patientDetails.phone_mobile ?? patientDetails.phone1 ?? patientDetails.phone2 ?? "-"}</p>
<p><strong>Nome social:</strong> {patientDetails.social_name ?? "-"}</p>
<p><strong>Sexo:</strong> {patientDetails.sex ?? "-"}</p>
<p><strong>Tipo sanguíneo:</strong> {patientDetails.blood_type ?? "-"}</p>
<p><strong>Peso:</strong> {patientDetails.weight_kg ?? "-"}{patientDetails.weight_kg ? "kg": ""}</p>
<p><strong>Altura:</strong> {patientDetails.height_m ?? "-"}{patientDetails.height_m ? "m": ""}</p>
<p><strong>IMC:</strong> {patientDetails.bmi ?? "-"}</p>
<p><strong>Endereço:</strong> {patientDetails.street ?? "-"}</p>
<p><strong>Bairro:</strong> {patientDetails.neighborhood ?? "-"}</p>
<p><strong>Cidade:</strong> {patientDetails.city ?? "-"}</p>
<p><strong>Estado:</strong> {patientDetails.state ?? "-"}</p>
<p><strong>CEP:</strong> {patientDetails.cep ?? "-"}</p>
<p><strong>Criado em:</strong> {patientDetails.created_at ?? "-"}</p>
<p><strong>Atualizado em:</strong> {patientDetails.updated_at ?? "-"}</p>
<p><strong>Id:</strong> {patientDetails.id ?? "-"}</p>
<p>
<strong>Nome:</strong> {patientDetails.full_name}
</p>
<p>
<strong>CPF:</strong> {patientDetails.cpf}
</p>
<p>
<strong>Email:</strong> {patientDetails.email}
</p>
<p>
<strong>Telefone:</strong> {patientDetails.phone_mobile ?? patientDetails.phone1 ?? patientDetails.phone2 ?? "-"}
</p>
<p>
<strong>Nome social:</strong> {patientDetails.social_name ?? "-"}
</p>
<p>
<strong>Sexo:</strong> {patientDetails.sex ?? "-"}
</p>
<p>
<strong>Tipo sanguíneo:</strong> {patientDetails.blood_type ?? "-"}
</p>
<p>
<strong>Peso:</strong> {patientDetails.weight_kg ?? "-"}
{patientDetails.weight_kg ? "kg" : ""}
</p>
<p>
<strong>Altura:</strong> {patientDetails.height_m ?? "-"}
{patientDetails.height_m ? "m" : ""}
</p>
<p>
<strong>IMC:</strong> {patientDetails.bmi ?? "-"}
</p>
<p>
<strong>Endereço:</strong> {patientDetails.street ?? "-"}
</p>
<p>
<strong>Bairro:</strong> {patientDetails.neighborhood ?? "-"}
</p>
<p>
<strong>Cidade:</strong> {patientDetails.city ?? "-"}
</p>
<p>
<strong>Estado:</strong> {patientDetails.state ?? "-"}
</p>
<p>
<strong>CEP:</strong> {patientDetails.cep ?? "-"}
</p>
<p>
<strong>Criado em:</strong> {patientDetails.created_at ?? "-"}
</p>
<p>
<strong>Atualizado em:</strong> {patientDetails.updated_at ?? "-"}
</p>
<p>
<strong>Id:</strong> {patientDetails.id ?? "-"}
</p>
</div>
)}
</AlertDialogDescription>

View File

@ -158,7 +158,7 @@ useEffect(() => {
<div className="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center">
<div className="w-4 h-4 bg-white rounded-sm"></div>
</div>
<span className="font-semibold text-gray-900">Hospital System</span>
<span className="font-semibold text-gray-900">MedConnect</span>
</div>
)}
<Button variant="ghost" size="sm" onClick={() => setSidebarCollapsed(!sidebarCollapsed)} className="p-1">

View File

@ -123,7 +123,7 @@ export default function HospitalLayout({ children }: HospitalLayoutProps) {
<div className="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center">
<div className="w-4 h-4 bg-white rounded-sm"></div>
</div>
<span className="font-semibold text-gray-900">Hospital System</span>
<span className="font-semibold text-gray-900">MedConnect</span>
</div>
)}
<Button variant="ghost" size="sm" onClick={() => setSidebarCollapsed(!sidebarCollapsed)} className="p-1">

View File

@ -112,9 +112,7 @@ export default function HospitalLayout({ children }: HospitalLayoutProps) {
<div className="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center">
<div className="w-4 h-4 bg-white rounded-sm"></div>
</div>
<span className="font-semibold text-gray-900">
MidConnecta
</span>
<span className="font-semibold text-gray-900">MedConnect</span>
</div>
)}
<Button

View File

@ -105,7 +105,7 @@ export default function SecretaryLayout({ children }: PatientLayoutProps) {
<div className="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center">
<div className="w-4 h-4 bg-white rounded-sm"></div>
</div>
<span className="font-semibold text-gray-900">MidConnecta</span>
<span className="font-semibold text-gray-900">MedConnect</span>
</div>
)}
<Button