- | {doctor.full_name} |
+
+ {doctor.full_name}
+ {doctor.phone_mobile}
+ |
{doctor.crm} |
{doctor.specialty} |
- {doctor.status || "N/A"} |
+
+
+ {doctor.status || "N/A"}
+
+ |
{(doctor.city || doctor.state)
? `${doctor.city || ""}${doctor.city && doctor.state ? '/' : ''}${doctor.state || ""}`
@@ -284,7 +316,7 @@ export default function DoctorsPage() {
|
- Ações
+ Ações
openDetailsDialog(doctor)}>
@@ -335,14 +367,26 @@ export default function DoctorsPage() {
) : (
{currentItems.map((doctor) => (
-
+
{doctor.full_name}
+ {doctor.phone_mobile}
{doctor.specialty}
+
+
+ {doctor.status || "N/A"}
+
+
- Ações
+
openDetailsDialog(doctor)}>
@@ -355,10 +399,6 @@ export default function DoctorsPage() {
Editar
-
-
- Marcar consulta
-
openDeleteDialog(doctor.id)}>
Excluir
@@ -406,7 +446,7 @@ export default function DoctorsPage() {
)}
- {/* Dialogs de Exclusão e Detalhes */}
+ {/* Dialogs (Exclusão e Detalhes) mantidos igual ao original... */}
diff --git a/app/manager/usuario/page.tsx b/app/manager/usuario/page.tsx
index 9cc8bbc..df0ece3 100644
--- a/app/manager/usuario/page.tsx
+++ b/app/manager/usuario/page.tsx
@@ -4,7 +4,8 @@ import React, { useEffect, useState, useCallback } from "react";
import Link from "next/link";
import { Button } from "@/components/ui/button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-import { Plus, Eye, Filter, Loader2 } from "lucide-react";
+import { Input } from "@/components/ui/input"; // <--- 1. Importação Adicionada
+import { Plus, Eye, Filter, Loader2, Search } from "lucide-react"; // <--- 1. Ícone Search Adicionado
import { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog";
import { api, login } from "services/api.mjs";
import { usersService } from "services/usersApi.mjs";
@@ -34,6 +35,9 @@ export default function UsersPage() {
const [userDetails, setUserDetails] = useState(
null
);
+
+ // --- Estados de Filtro ---
+ const [searchTerm, setSearchTerm] = useState(""); // <--- 2. Estado da busca
const [selectedRole, setSelectedRole] = useState("all");
// --- Lógica de Paginação INÍCIO ---
@@ -118,10 +122,21 @@ export default function UsersPage() {
}
};
- const filteredUsers =
- selectedRole && selectedRole !== "all"
- ? users.filter((u) => u.role === selectedRole)
- : users;
+ // --- 3. Lógica de Filtragem Atualizada ---
+ const filteredUsers = users.filter((u) => {
+ // Filtro por Papel (Role)
+ const roleMatch = selectedRole === "all" || u.role === selectedRole;
+
+ // Filtro da Barra de Pesquisa (Nome, Email ou Telefone)
+ const searchLower = searchTerm.toLowerCase();
+ const nameMatch = u.full_name?.toLowerCase().includes(searchLower);
+ const emailMatch = u.email?.toLowerCase().includes(searchLower);
+ const phoneMatch = u.phone?.includes(searchLower);
+
+ const searchMatch = !searchTerm || nameMatch || emailMatch || phoneMatch;
+
+ return roleMatch && searchMatch;
+ });
const indexOfLastItem = currentPage * itemsPerPage;
const indexOfFirstItem = indexOfLastItem - itemsPerPage;
@@ -180,60 +195,71 @@ export default function UsersPage() {
- {/* Filtro e Itens por Página */}
-
+ {/* --- 4. Filtro (Barra de Pesquisa + Selects) --- */}
+
- {/* Select de Filtro por Papel - Ajustado para resetar a página */}
-
-
- Filtrar por papel
-
-
{/* --- SEÇÃO DE TABELA (VISÍVEL EM TELAS MAIORES OU IGUAIS A MD) --- */}
diff --git a/components/ui/patient-details-modal.tsx b/components/ui/patient-details-modal.tsx
index fea1040..8a37050 100644
--- a/components/ui/patient-details-modal.tsx
+++ b/components/ui/patient-details-modal.tsx
@@ -1,96 +1,147 @@
-'use client'
+"use client";
import {
- Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
} from "@/components/ui/dialog";
+import { Button } from "@/components/ui/button";
+
+interface Paciente {
+ id: string;
+ nome: string;
+ telefone: string;
+ cidade: string;
+ estado: string;
+ email?: string;
+ birth_date?: string;
+ cpf?: string;
+ blood_type?: string;
+ weight_kg?: number;
+ height_m?: number;
+ street?: string;
+ number?: string;
+ complement?: string;
+ neighborhood?: string;
+ cep?: string;
+ [key: string]: any; // Para permitir outras propriedades se necessário
+}
interface PatientDetailsModalProps {
+ patient: Paciente | null;
isOpen: boolean;
- patient: any;
onClose: () => void;
}
-export function PatientDetailsModal({ patient, isOpen, onClose }: PatientDetailsModalProps) {
+export function PatientDetailsModal({
+ patient,
+ isOpen,
+ onClose,
+}: PatientDetailsModalProps) {
if (!patient) return null;
return (
|