Merge pull request #33 from m1guelmcf/acessibility

Acessibility
This commit is contained in:
Jhony-Reis 2025-11-30 01:42:31 -03:00 committed by GitHub
commit 5b8ee4e9f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 761 additions and 742 deletions

View File

@ -19,20 +19,25 @@ interface AccessibilityContextProps {
const AccessibilityContext = createContext<AccessibilityContextProps | undefined>(undefined);
export const AccessibilityProvider = ({ children }: { children: ReactNode }) => {
const [theme, setThemeState] = useState<Theme>('light');
const [contrast, setContrastState] = useState<Contrast>('normal');
const [fontSize, setFontSize] = useState<number>(16);
useEffect(() => {
const storedTheme = (localStorage.getItem('accessibility-theme') as Theme) || 'light';
const storedContrast = (localStorage.getItem('accessibility-contrast') as Contrast) || 'normal';
const storedSize = localStorage.getItem('accessibility-font-size');
setThemeState(storedTheme);
setContrastState(storedContrast);
if (storedSize) {
setFontSize(parseFloat(storedSize));
const [theme, setThemeState] = useState<Theme>(() => {
if (typeof window !== 'undefined') {
return (localStorage.getItem('accessibility-theme') as Theme) || 'light';
}
}, []);
return 'light';
});
const [contrast, setContrastState] = useState<Contrast>(() => {
if (typeof window !== 'undefined') {
return (localStorage.getItem('accessibility-contrast') as Contrast) || 'normal';
}
return 'normal';
});
const [fontSize, setFontSize] = useState<number>(() => {
if (typeof window !== 'undefined') {
const storedSize = localStorage.getItem('accessibility-font-size');
return storedSize ? parseFloat(storedSize) : 16;
}
return 16;
});
useEffect(() => {
const root = document.documentElement;

View File

@ -264,8 +264,8 @@ export default function PatientDashboard() {
<Sidebar>
<div className="space-y-6">
<div>
<h1 className="text-3xl font-bold text-gray-900">Dashboard</h1>
<p className="text-gray-600">
<h1 className="text-3xl font-bold">Dashboard</h1>
<p className="text-muted-foreground">
Bem-vindo ao seu portal de consultas médicas
</p>
</div>
@ -367,21 +367,21 @@ export default function PatientDashboard() {
return (
<div key={ex.id} className="space-y-4">
<div className="flex flex-col items-center justify-between p-3 bg-blue-50 rounded-lg shadow-sm">
<div className="flex flex-col items-center justify-between p-3 bg-primary/10 rounded-lg shadow-sm">
<div className="text-center">
<p className="font-semibold capitalize">{date}</p>
<p className="text-sm text-gray-600">
<p className="text-sm text-muted-foreground">
{startTime && endTime
? `${startTime} - ${endTime}`
: "Dia todo"}
</p>
</div>
<div className="text-center mt-2">
<p className={`text-sm font-medium ${ex.kind === "bloqueio" ? "text-red-600" : "text-green-600"}`}>{ex.kind === "bloqueio" ? "Bloqueio" : "Liberação"}</p>
<p className="text-xs text-gray-500 italic">{ex.reason || "Sem motivo especificado"}</p>
<p className={`text-sm font-medium ${ex.kind === "bloqueio" ? "text-destructive" : "text-primary"}`}>{ex.kind === "bloqueio" ? "Bloqueio" : "Liberação"}</p>
<p className="text-xs text-muted-foreground italic">{ex.reason || "Sem motivo especificado"}</p>
</div>
<div>
<Button className="text-red-600" variant="outline" onClick={() => openDeleteDialog(String(ex.id))}>
<Button className="text-destructive" variant="outline" onClick={() => openDeleteDialog(String(ex.id))}>
<Trash2></Trash2>
</Button>
</div>
@ -390,7 +390,7 @@ export default function PatientDashboard() {
);
})
) : (
<p className="text-sm text-gray-400 italic col-span-7 text-center">Nenhuma exceção registrada.</p>
<p className="text-sm text-muted-foreground italic col-span-7 text-center">Nenhuma exceção registrada.</p>
)}
</CardContent>
</Card>
@ -403,7 +403,7 @@ export default function PatientDashboard() {
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancelar</AlertDialogCancel>
<AlertDialogAction onClick={() => exceptionToDelete && handleDeleteException(exceptionToDelete)} className="bg-red-600 hover:bg-red-700">
<AlertDialogAction onClick={() => exceptionToDelete && handleDeleteException(exceptionToDelete)} className="bg-destructive hover:bg-destructive/90">
Excluir
</AlertDialogAction>
</AlertDialogFooter>

View File

@ -149,12 +149,12 @@ export default function ExceptionPage() {
<Sidebar>
<div className="space-y-6">
<div>
<h1 className="text-3xl font-bold text-gray-900">Adicione exceções</h1>
<p className="text-gray-600">Altere a disponibilidade em casos especiais para o Dr. João Silva</p>
<h1 className="text-3xl font-bold text-foreground">Adicione exceções</h1>
<p className="text-muted-foreground">Altere a disponibilidade em casos especiais para o Dr. João Silva</p>
</div>
<div className="flex justify-between items-center">
<h2 className="text-xl font-semibold">Consultas para: {displayDate}</h2>
<h2 className="text-xl font-semibold text-foreground">Consultas para: {displayDate}</h2>
<Button disabled={isLoading} variant="outline" size="sm">
<RefreshCw className={`mr-2 h-4 w-4 ${isLoading ? "animate-spin" : ""}`} />
Atualizar Agenda
@ -171,7 +171,7 @@ export default function ExceptionPage() {
<CalendarIcon className="mr-2 h-5 w-5" />
Calendário
</CardTitle>
<p className="text-sm text-gray-500">Selecione a data desejada.</p>
<p className="text-sm text-muted-foreground">Selecione a data desejada.</p>
</CardHeader>
<CardContent className="flex justify-center p-2">
<Calendar
@ -194,23 +194,23 @@ export default function ExceptionPage() {
{/* COLUNA 2: FORM PARA ADICIONAR EXCEÇÃO */}
<div className="lg:col-span-2 space-y-4">
{isLoading ? (
<p className="text-center text-lg text-gray-500">Carregando a agenda...</p>
<p className="text-center text-lg text-muted-foreground">Carregando a agenda...</p>
) : !selectedCalendarDate ? (
<p className="text-center text-lg text-gray-500">Selecione uma data.</p>
<p className="text-center text-lg text-muted-foreground">Selecione uma data.</p>
) : (
<form className="space-y-6" onSubmit={handleSubmit}>
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Dados </h2>
<div className="bg-card rounded-lg border border-border p-6">
<h2 className="text-lg font-semibold text-foreground mb-6">Dados </h2>
<div className="space-y-6">
<div className="grid md:grid-cols-5 gap-6">
<div>
<Label htmlFor="horarioEntrada" className="text-sm font-medium text-gray-700">
<Label htmlFor="horarioEntrada" className="text-sm font-medium text-foreground">
Horario De Entrada
</Label>
<Input type="time" id="horarioEntrada" name="horarioEntrada" className="mt-1" />
</div>
<div>
<Label htmlFor="horarioSaida" className="text-sm font-medium text-gray-700">
<Label htmlFor="horarioSaida" className="text-sm font-medium text-foreground">
Horario De Saida
</Label>
<Input type="time" id="horarioSaida" name="horarioSaida" className="mt-1" />
@ -218,7 +218,7 @@ export default function ExceptionPage() {
</div>
<div>
<Label htmlFor="tipo" className="text-sm font-medium text-gray-700">
<Label htmlFor="tipo" className="text-sm font-medium text-foreground">
Tipo
</Label>
<Select onValueChange={(value) => setTipo(value)} value={tipo}>
@ -232,7 +232,7 @@ export default function ExceptionPage() {
</Select>
</div>
<div>
<Label htmlFor="reason" className="text-sm font-medium text-gray-700">
<Label htmlFor="reason" className="text-sm font-medium text-foreground">
Motivo
</Label>
<Input type="textarea" id="reason" name="reason" required className="mt-1" />
@ -244,7 +244,7 @@ export default function ExceptionPage() {
<Link href="/doctor/disponibilidade">
<Button variant="outline">Cancelar</Button>
</Link>
<Button type="submit" className="bg-green-600 hover:bg-green-700">
<Button type="submit" className="bg-green-600 hover:bg-green-700 text-white">
Salvar Exceção
</Button>
</div>

View File

@ -379,23 +379,23 @@ export default function AvailabilityPage() {
<div className="space-y-6 flex-1 overflow-y-auto p-6">
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold text-gray-900">
<h1 className="text-2xl font-bold">
Definir Disponibilidade
</h1>
<p className="text-gray-600">
<p className="text-muted-foreground">
Defina sua disponibilidade para consultas{" "}
</p>
</div>
</div>
<form className="space-y-6" onSubmit={handleSubmit}>
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Dados </h2>
<div className="bg-card rounded-lg border p-6">
<h2 className="text-lg font-semibold mb-6">Dados </h2>
<div className="space-y-6">
{/* **AJUSTE DE RESPONSIVIDADE: DIAS DA SEMANA** */}
<div>
<Label className="text-sm font-medium text-gray-700">
<Label className="text-sm font-medium">
Dia Da Semana
</Label>
{/* O antigo 'flex gap-4 mt-2 flex-nowrap' foi substituído por um grid responsivo: */}
@ -405,7 +405,7 @@ export default function AvailabilityPage() {
type="radio"
name="weekday"
value="monday"
className="text-blue-600"
className="text-primary"
/>
<span className="whitespace-nowrap text-sm">Segunda</span>
</label>
@ -414,7 +414,7 @@ export default function AvailabilityPage() {
type="radio"
name="weekday"
value="tuesday"
className="text-blue-600"
className="text-primary"
/>
<span className="whitespace-nowrap text-sm">Terça</span>
</label>
@ -423,7 +423,7 @@ export default function AvailabilityPage() {
type="radio"
name="weekday"
value="wednesday"
className="text-blue-600"
className="text-primary"
/>
<span className="whitespace-nowrap text-sm">Quarta</span>
</label>
@ -432,7 +432,7 @@ export default function AvailabilityPage() {
type="radio"
name="weekday"
value="thursday"
className="text-blue-600"
className="text-primary"
/>
<span className="whitespace-nowrap text-sm">Quinta</span>
</label>
@ -441,7 +441,7 @@ export default function AvailabilityPage() {
type="radio"
name="weekday"
value="friday"
className="text-blue-600"
className="text-primary"
/>
<span className="whitespace-nowrap text-sm">Sexta</span>
</label>
@ -450,7 +450,7 @@ export default function AvailabilityPage() {
type="radio"
name="weekday"
value="saturday"
className="text-blue-600"
className="text-primary"
/>
<span className="whitespace-nowrap text-sm">Sábado</span>
</label>
@ -459,7 +459,7 @@ export default function AvailabilityPage() {
type="radio"
name="weekday"
value="sunday"
className="text-blue-600"
className="text-primary"
/>
<span className="whitespace-nowrap text-sm">Domingo</span>
</label>
@ -472,7 +472,7 @@ export default function AvailabilityPage() {
<div>
<Label
htmlFor="horarioEntrada"
className="text-sm font-medium text-gray-700"
className="text-sm font-medium"
>
Horario De Entrada
</Label>
@ -487,7 +487,7 @@ export default function AvailabilityPage() {
<div>
<Label
htmlFor="horarioSaida"
className="text-sm font-medium text-gray-700"
className="text-sm font-medium"
>
Horario De Saida
</Label>
@ -502,7 +502,7 @@ export default function AvailabilityPage() {
<div>
<Label
htmlFor="duracaoConsulta"
className="text-sm font-medium text-gray-700"
className="text-sm font-medium"
>
Duração Da Consulta (min)
</Label>
@ -520,7 +520,7 @@ export default function AvailabilityPage() {
<div>
<Label
htmlFor="modalidadeConsulta"
className="text-sm font-medium text-gray-700"
className="text-sm font-medium"
>
Modalidade De Consulta
</Label>
@ -551,7 +551,7 @@ export default function AvailabilityPage() {
<Link href="/doctor/dashboard" className="w-full sm:w-auto">
<Button variant="outline" className="w-full sm:w-auto">Cancelar</Button>
</Link>
<Button type="submit" className="bg-blue-600 hover:bg-blue-700 w-full sm:w-auto">
<Button type="submit" className="bg-primary hover:bg-primary/90 w-full sm:w-auto">
Salvar Disponibilidade
</Button>
</div>
@ -571,7 +571,7 @@ export default function AvailabilityPage() {
const times = schedule[day] || [];
return (
<div key={day} className="space-y-4">
<div className="flex flex-col items-center justify-between p-3 bg-blue-50 rounded-lg h-full">
<div className="flex flex-col items-center justify-between p-3 bg-primary/10 rounded-lg h-full">
<p className="font-medium capitalize text-center mb-2">{weekdaysPT[day]}</p>
<div className="text-center w-full">
{times.length > 0 ? (
@ -579,7 +579,7 @@ export default function AvailabilityPage() {
<div key={i}>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<p className="text-sm text-gray-600 cursor-pointer rounded hover:text-accent-foreground hover:bg-gray-200 transition-colors duration-150">
<p className="text-sm text-muted-foreground cursor-pointer rounded hover:text-accent-foreground hover:bg-muted transition-colors duration-150">
{formatTime(t.start)} - {formatTime(t.end)}
</p>
</DropdownMenuTrigger>
@ -590,7 +590,7 @@ export default function AvailabilityPage() {
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => openDeleteDialog(t, day)}
className="text-red-600 focus:bg-red-50 focus:text-red-600">
className="text-destructive focus:bg-destructive/10 focus:text-destructive">
<Trash2 className="w-4 h-4 mr-2" />
Excluir
</DropdownMenuItem>
@ -599,7 +599,7 @@ export default function AvailabilityPage() {
</div>
))
) : (
<p className="text-sm text-gray-400 italic">Sem horário</p>
<p className="text-sm text-muted-foreground italic">Sem horário</p>
)}
</div>
</div>
@ -619,7 +619,7 @@ export default function AvailabilityPage() {
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancelar</AlertDialogCancel>
<AlertDialogAction onClick={() => selectedAvailability && handleDeleteAvailability(selectedAvailability.id)} className="bg-red-600 hover:bg-red-700">
<AlertDialogAction onClick={() => selectedAvailability && handleDeleteAvailability(selectedAvailability.id)} className="bg-destructive hover:bg-destructive/90">
Excluir
</AlertDialogAction>
</AlertDialogFooter>

View File

@ -16,8 +16,8 @@
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--destructive: oklch(0.637 0.237 25.331);
--destructive-foreground: oklch(0.985 0 0);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
@ -52,8 +52,8 @@
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--destructive: oklch(0.7 0.25 25);
--destructive-foreground: oklch(0.985 0 0);
--border: oklch(0.269 0 0);
--input: oklch(0.269 0 0);
--ring: oklch(0.439 0 0);
@ -87,7 +87,7 @@
--muted-foreground: oklch(1 0.5 100);
--accent: oklch(0 0 0);
--accent-foreground: oklch(1 0.5 100);
--destructive: oklch(0.5 0.3 30);
--destructive: oklch(0.8 0.5 25);
--destructive-foreground: oklch(0 0 0);
--border: oklch(1 0.5 100);
--input: oklch(0 0 0);

View File

@ -4,11 +4,7 @@ import { GeistMono } from "geist/font/mono";
import { Analytics } from "@vercel/analytics/next";
import "./globals.css";
import { Toaster } from "@/components/ui/toaster";
// [PASSO 1.2] - Importando o nosso provider
import { AppointmentsProvider } from "./context/AppointmentsContext";
import { AccessibilityProvider } from "./context/AccessibilityContext";
import { AccessibilityModal } from "@/components/accessibility-modal";
import { ThemeInitializer } from "@/components/theme-initializer";
import { Providers } from "./providers";
export default function RootLayout({
children,
@ -18,12 +14,7 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<body className={`font-sans ${GeistSans.variable} ${GeistMono.variable}`}>
{/* [PASSO 1.2] - Envolvendo a aplicação com o provider */}
<ThemeInitializer />
<AccessibilityProvider>
<AppointmentsProvider>{children}</AppointmentsProvider>
<AccessibilityModal />
</AccessibilityProvider>
<Providers>{children}</Providers>
<Analytics />
<Toaster />
</body>

View File

@ -97,7 +97,7 @@ export default function LoginPage() {
</div>
{/* O contêiner principal que agora terá a sombra e o estilo de card */}
<div className="w-full max-w-md bg-card p-10 rounded-2xl shadow-xl">
<div className="w-full max-w-md bg-card p-10 rounded-2xl shadow-xl border-2 border-border mt-8">
{/* NOVO: Bloco da Logo e Nome (Painel Esquerdo) */}
<div className="flex items-center justify-center space-x-3 mb-8">
<img
@ -155,6 +155,7 @@ export default function LoginPage() {
fill
style={{ objectFit: "cover" }}
priority
className="dark:opacity-80"
/>
{/* Camada de sobreposição para escurecer a imagem e destacar o texto */}
<div className="absolute inset-0 bg-primary/80 flex flex-col items-start justify-end p-12 text-left">

View File

@ -94,8 +94,8 @@ export default function ManagerDashboard() {
<div className="space-y-6">
{/* Cabeçalho */}
<div>
<h1 className="text-3xl font-bold text-gray-900">Dashboard</h1>
<p className="text-gray-600">
<h1 className="text-3xl font-bold">Dashboard</h1>
<p className="text-muted-foreground">
Bem-vindo ao seu portal de consultas médicas
</p>
</div>
@ -114,7 +114,7 @@ export default function ManagerDashboard() {
</CardHeader>
<CardContent>
{loadingUser ? (
<div className="text-gray-500 text-sm">
<div className="text-muted-foreground text-sm">
Carregando usuário...
</div>
) : firstUser ? (
@ -127,7 +127,7 @@ export default function ManagerDashboard() {
</p>
</>
) : (
<div className="text-sm text-gray-500">
<div className="text-sm text-muted-foreground">
Nenhum usuário encontrado
</div>
)}
@ -159,15 +159,15 @@ export default function ManagerDashboard() {
</CardHeader>
<CardContent className="space-y-4">
<Link href="/manager/home">
<Button className="w-full justify-start bg-blue-600 text-white hover:bg-blue-700">
<User className="mr-2 h-4 w-4 text-white" />
<Button className="w-full justify-start">
<User className="mr-2 h-4 w-4" />
Gestão de Médicos
</Button>
</Link>
<Link href="/manager/usuario">
<Button
variant="outline"
className="w-full justify-start bg-transparent"
className="w-full justify-start"
>
<User className="mr-2 h-4 w-4" />
Usuários Cadastrados
@ -176,7 +176,7 @@ export default function ManagerDashboard() {
<Link href="/manager/home/novo">
<Button
variant="outline"
className="w-full justify-start bg-transparent"
className="w-full justify-start"
>
<Plus className="mr-2 h-4 w-4" />
Adicionar Novo Médico
@ -185,7 +185,7 @@ export default function ManagerDashboard() {
<Link href="/manager/usuario/novo">
<Button
variant="outline"
className="w-full justify-start bg-transparent"
className="w-full justify-start"
>
<Plus className="mr-2 h-4 w-4" />
Criar novo Usuário
@ -204,9 +204,9 @@ export default function ManagerDashboard() {
</CardHeader>
<CardContent>
{loadingDoctors ? (
<p className="text-sm text-gray-500">Carregando médicos...</p>
<p className="text-sm text-muted-foreground">Carregando médicos...</p>
) : doctors.length === 0 ? (
<p className="text-sm text-gray-500">
<p className="text-sm text-muted-foreground">
Nenhum médico cadastrado.
</p>
) : (
@ -214,18 +214,18 @@ export default function ManagerDashboard() {
{doctors.map((doc, index) => (
<div
key={index}
className="flex items-center justify-between p-3 bg-green-50 rounded-lg border border-green-100"
className="flex items-center justify-between p-3 bg-secondary rounded-lg border"
>
<div>
<p className="font-medium">
{doc.full_name || "Sem nome"}
</p>
<p className="text-sm text-gray-600">
<p className="text-sm text-muted-foreground">
{doc.specialty || "Sem especialidade"}
</p>
</div>
<div className="text-right">
<p className="font-medium text-green-700">
<p className="font-medium text-primary">
{doc.active ? "Ativo" : "Inativo"}
</p>
</div>

View File

@ -84,7 +84,7 @@ export default function AllAvailabilities() {
if (loading) {
return (
<Sidebar>
<div className="p-6 text-gray-500">Carregando dados...</div>
<div className="p-6 text-muted-foreground">Carregando dados...</div>
</Sidebar>
);
}
@ -92,7 +92,7 @@ export default function AllAvailabilities() {
if (!doctors || !availabilities) {
return (
<Sidebar>
<div className="p-6 text-red-600 font-medium">Não foi possível carregar médicos ou disponibilidades.</div>
<div className="p-6 text-destructive font-medium">Não foi possível carregar médicos ou disponibilidades.</div>
</Sidebar>
);
}
@ -101,8 +101,8 @@ export default function AllAvailabilities() {
<Sidebar>
<div className="space-y-6">
<div>
<h1 className="text-3xl font-bold text-gray-900">Disponibilidade dos Médicos</h1>
<p className="text-gray-600">Visualize a agenda semanal individual de cada médico.</p>
<h1 className="text-3xl font-bold">Disponibilidade dos Médicos</h1>
<p className="text-muted-foreground">Visualize a agenda semanal individual de cada médico.</p>
</div>
<Card>
<CardContent>
@ -170,7 +170,7 @@ export default function AllAvailabilities() {
Anterior
</Button>
<span className="text-gray-700 font-medium">
<span className="text-muted-foreground font-medium">
Página {page} de {totalPages}
</span>

View File

@ -209,8 +209,8 @@ export default function EditarMedicoPage() {
return (
<Sidebar>
<div className="flex justify-center items-center h-full w-full py-16">
<Loader2 className="w-8 h-8 animate-spin text-green-600" />
<p className="ml-2 text-gray-600">Carregando dados do médico...</p>
<Loader2 className="w-8 h-8 animate-spin text-primary" />
<p className="ml-2 text-muted-foreground">Carregando dados do médico...</p>
</div>
</Sidebar>
);
@ -221,10 +221,10 @@ export default function EditarMedicoPage() {
<div className="w-full space-y-6 p-4 md:p-8">
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold text-gray-900">
Editar Médico: <span className="text-green-600">{formData.nomeCompleto}</span>
<h1 className="text-2xl font-bold text-foreground">
Editar Médico: <span className="text-primary">{formData.nomeCompleto}</span>
</h1>
<p className="text-sm text-gray-500">
<p className="text-sm text-muted-foreground">
Atualize as informações do médico
</p>
</div>
@ -239,14 +239,14 @@ export default function EditarMedicoPage() {
<form onSubmit={handleSubmit} className="space-y-6">
{error && (
<div className="p-3 bg-red-100 text-red-700 rounded-lg border border-red-300">
<div className="p-3 rounded-lg border bg-destructive/10 text-destructive border-destructive/30">
<p className="font-medium">Erro na Atualização:</p>
<p className="text-sm">{error}</p>
</div>
)}
<div className="space-y-4 p-4 border rounded-xl shadow-sm bg-white">
<h2 className="text-lg font-semibold text-gray-800 border-b pb-2">
<div className="space-y-4 p-4 rounded-xl border border-border shadow-sm bg-card">
<h2 className="text-lg font-semibold text-foreground border-b border-border pb-2">
Dados Principais e Pessoais
</h2>
<div className="grid md:grid-cols-4 gap-4">
@ -348,8 +348,8 @@ export default function EditarMedicoPage() {
</div>
</div>
<div className="space-y-4 p-4 border rounded-xl shadow-sm bg-white">
<h2 className="text-lg font-semibold text-gray-800 border-b pb-2">
<div className="space-y-4 p-4 rounded-xl border border-border shadow-sm bg-card">
<h2 className="text-lg font-semibold text-foreground border-b border-border pb-2">
Contato e Endereço
</h2>
@ -452,8 +452,8 @@ export default function EditarMedicoPage() {
</div>
<div className="space-y-4 p-4 border rounded-xl shadow-sm bg-white">
<h2 className="text-lg font-semibold text-gray-800 border-b pb-2">
<div className="space-y-4 p-4 rounded-xl border border-border shadow-sm bg-card">
<h2 className="text-lg font-semibold text-foreground border-b border-border pb-2">
Observações (Apenas internas)
</h2>
<Textarea
@ -474,7 +474,7 @@ export default function EditarMedicoPage() {
</Link>
<Button
type="submit"
className="bg-green-600 hover:bg-green-700"
className="bg-primary hover:bg-primary/90"
disabled={isSaving}
>
{isSaving ? (

View File

@ -224,10 +224,10 @@ export default function DoctorsPage() {
{/* Cabeçalho */}
<div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3">
<div>
<h1 className="text-2xl font-bold text-gray-900">
<h1 className="text-2xl font-bold">
Médicos Cadastrados
</h1>
<p className="text-sm text-gray-500">
<p className="text-sm text-muted-foreground">
Gerencie todos os profissionais de saúde.
</p>
</div>
@ -270,54 +270,54 @@ export default function DoctorsPage() {
</FilterBar>
{/* Tabela de Médicos */}
<div className="bg-white rounded-lg border border-gray-200 shadow-md overflow-hidden hidden md:block">
<div className="bg-card rounded-lg border shadow-md overflow-hidden hidden md:block">
{loading ? (
<div className="p-8 text-center text-gray-500">
<Loader2 className="w-8 h-8 animate-spin mx-auto mb-3 text-green-600" />
<div className="p-8 text-center text-muted-foreground">
<Loader2 className="w-8 h-8 animate-spin mx-auto mb-3 text-primary" />
Carregando médicos...
</div>
) : error ? (
<div className="p-8 text-center text-red-600">{error}</div>
<div className="p-8 text-center text-destructive">{error}</div>
) : filteredDoctors.length === 0 ? (
<div className="p-8 text-center text-gray-500">
<div className="p-8 text-center text-muted-foreground">
{doctors.length === 0
? <>Nenhum médico cadastrado. <Link href="/manager/home/novo" className="text-green-600 hover:underline">Adicione um novo</Link>.</>
? <>Nenhum médico cadastrado. <Link href="/manager/home/novo" className="text-primary hover:underline">Adicione um novo</Link>.</>
: "Nenhum médico encontrado com os filtros aplicados."
}
</div>
) : (
<div className="overflow-x-auto">
<table className="w-full min-w-[600px]">
<thead className="bg-gray-50 border-b border-gray-200">
<thead className="bg-muted border-b">
<tr>
<th className="text-left p-2 md:p-4 font-medium text-gray-700">Nome</th>
<th className="text-left p-2 md:p-4 font-medium text-gray-700">CRM</th>
<th className="text-left p-2 md:p-4 font-medium text-gray-700">Especialidade</th>
<th className="text-left p-2 md:p-4 font-medium text-gray-700 hidden lg:table-cell">Status</th>
<th className="text-left p-2 md:p-4 font-medium text-gray-700 hidden xl:table-cell">Cidade/Estado</th>
<th className="text-right p-4 font-medium text-gray-700">Ações</th>
<th className="text-left p-2 md:p-4 font-medium text-muted-foreground">Nome</th>
<th className="text-left p-2 md:p-4 font-medium text-muted-foreground">CRM</th>
<th className="text-left p-2 md:p-4 font-medium text-muted-foreground">Especialidade</th>
<th className="text-left p-2 md:p-4 font-medium text-muted-foreground hidden lg:table-cell">Status</th>
<th className="text-left p-2 md:p-4 font-medium text-muted-foreground hidden xl:table-cell">Cidade/Estado</th>
<th className="text-right p-4 font-medium text-muted-foreground">Ações</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
<tbody className="bg-card divide-y">
{currentItems.map((doctor) => (
<tr key={doctor.id} className="hover:bg-gray-50 transition">
<td className="px-4 py-3 font-medium text-gray-900">
<tr key={doctor.id} className="hover:bg-muted transition">
<td className="px-4 py-3 font-medium">
{doctor.full_name}
</td>
<td className="px-4 py-3 text-gray-500 hidden sm:table-cell">{doctor.crm}</td>
<td className="px-4 py-3 text-gray-500 hidden md:table-cell">
<td className="px-4 py-3 text-muted-foreground hidden sm:table-cell">{doctor.crm}</td>
<td className="px-4 py-3 text-muted-foreground hidden md:table-cell">
{/* Exibe Especialidade Normalizada */}
{normalizeSpecialty(doctor.specialty)}
</td>
<td className="px-4 py-3 text-gray-500 hidden lg:table-cell">
<td className="px-4 py-3 text-muted-foreground hidden lg:table-cell">
<span className={`px-2 py-1 rounded-full text-xs ${
doctor.status === 'Ativo' ? 'bg-green-100 text-green-800' :
doctor.status === 'Inativo' ? 'bg-red-100 text-red-800' : 'bg-yellow-100 text-yellow-800'
doctor.status === 'Ativo' ? 'bg-primary/10 text-primary' :
doctor.status === 'Inativo' ? 'bg-destructive/10 text-destructive' : 'bg-yellow-400/10 text-yellow-400'
}`}>
{doctor.status || "N/A"}
</span>
</td>
<td className="px-4 py-3 text-gray-500 hidden xl:table-cell">
<td className="px-4 py-3 text-muted-foreground hidden xl:table-cell">
{(doctor.city || doctor.state)
? `${doctor.city || ""}${doctor.city && doctor.state ? '/' : ''}${doctor.state || ""}`
: "N/A"}
@ -345,7 +345,7 @@ export default function DoctorsPage() {
<Calendar className="mr-2 h-4 w-4" />
Marcar consulta
</DropdownMenuItem>
<DropdownMenuItem className="text-red-600" onClick={() => openDeleteDialog(doctor.id)}>
<DropdownMenuItem className="text-destructive" onClick={() => openDeleteDialog(doctor.id)}>
<Trash2 className="mr-2 h-4 w-4" />
Excluir
</DropdownMenuItem>
@ -361,33 +361,33 @@ export default function DoctorsPage() {
</div>
{/* Cards de Médicos (Mobile) */}
<div className="bg-white rounded-lg border border-gray-200 shadow-md p-4 block md:hidden">
<div className="bg-card rounded-lg border shadow-md p-4 block md:hidden">
{loading ? (
<div className="p-8 text-center text-gray-500">
<Loader2 className="w-8 h-8 animate-spin mx-auto mb-3 text-green-600" />
<div className="p-8 text-center text-muted-foreground">
<Loader2 className="w-8 h-8 animate-spin mx-auto mb-3 text-primary" />
Carregando médicos...
</div>
) : error ? (
<div className="p-8 text-center text-red-600">{error}</div>
<div className="p-8 text-center text-destructive">{error}</div>
) : filteredDoctors.length === 0 ? (
<div className="p-8 text-center text-gray-500">
<div className="p-8 text-center text-muted-foreground">
{doctors.length === 0
? <>Nenhum médico cadastrado. <Link href="/manager/home/novo" className="text-green-600 hover:underline">Adicione um novo</Link>.</>
? <>Nenhum médico cadastrado. <Link href="/manager/home/novo" className="text-primary hover:underline">Adicione um novo</Link>.</>
: "Nenhum médico encontrado com os filtros aplicados."
}
</div>
) : (
<div className="space-y-4">
{currentItems.map((doctor) => (
<div key={doctor.id} className="bg-gray-50 rounded-lg p-4 flex justify-between items-center border border-gray-100">
<div key={doctor.id} className="bg-muted rounded-lg p-4 flex justify-between items-center border">
<div>
<div className="font-semibold text-gray-900">{doctor.full_name}</div>
<div className="text-xs text-gray-500 mb-1">{doctor.phone_mobile}</div>
<div className="text-sm text-gray-600">{normalizeSpecialty(doctor.specialty)}</div>
<div className="font-semibold">{doctor.full_name}</div>
<div className="text-xs text-muted-foreground mb-1">{doctor.phone_mobile}</div>
<div className="text-sm text-muted-foreground">{normalizeSpecialty(doctor.specialty)}</div>
<div className="text-xs mt-1">
<span className={`px-2 py-0.5 rounded-full text-xs ${
doctor.status === 'Ativo' ? 'bg-green-100 text-green-800' :
doctor.status === 'Inativo' ? 'bg-red-100 text-red-800' : 'bg-yellow-100 text-yellow-800'
doctor.status === 'Ativo' ? 'bg-primary/10 text-primary' :
doctor.status === 'Inativo' ? 'bg-destructive/10 text-destructive' : 'bg-yellow-400/10 text-yellow-400'
}`}>
{doctor.status || "N/A"}
</span>
@ -397,7 +397,7 @@ export default function DoctorsPage() {
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="sm" className="h-8 w-8 p-0">
<span className="sr-only">Abrir menu</span>
<div className="font-bold text-gray-500">...</div>
<div className="font-bold text-muted-foreground">...</div>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
@ -411,7 +411,7 @@ export default function DoctorsPage() {
Editar
</Link>
</DropdownMenuItem>
<DropdownMenuItem className="text-red-600" onClick={() => openDeleteDialog(doctor.id)}>
<DropdownMenuItem className="text-destructive" onClick={() => openDeleteDialog(doctor.id)}>
<Trash2 className="mr-2 h-4 w-4" />
Excluir
</DropdownMenuItem>
@ -425,11 +425,11 @@ export default function DoctorsPage() {
{/* Paginação */}
{totalPages > 1 && (
<div className="flex flex-wrap justify-center items-center gap-2 mt-4 p-4 bg-white rounded-lg border border-gray-200 shadow-md">
<div className="flex flex-wrap justify-center items-center gap-2 mt-4 p-4 bg-card rounded-lg border shadow-md">
<button
onClick={goToPrevPage}
disabled={currentPage === 1}
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed border border-gray-300"
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-muted text-muted-foreground hover:bg-muted/90 disabled:opacity-50 disabled:cursor-not-allowed border"
>
{"< Anterior"}
</button>
@ -438,10 +438,10 @@ export default function DoctorsPage() {
<button
key={number}
onClick={() => paginate(number)}
className={`px-4 py-2 rounded-md font-medium transition-colors text-sm border border-gray-300 ${
className={`px-4 py-2 rounded-md font-medium transition-colors text-sm border ${
currentPage === number
? "bg-blue-600 text-white shadow-md border-blue-600"
: "bg-gray-100 text-gray-700 hover:bg-gray-200"
? "bg-primary text-primary-foreground shadow-md border-primary"
: "bg-muted text-muted-foreground hover:bg-muted/90"
}`}
>
{number}
@ -451,7 +451,7 @@ export default function DoctorsPage() {
<button
onClick={goToNextPage}
disabled={currentPage === totalPages}
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed border border-gray-300"
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-muted text-muted-foreground hover:bg-muted/90 disabled:opacity-50 disabled:cursor-not-allowed border"
>
{"Próximo >"}
</button>
@ -467,7 +467,7 @@ export default function DoctorsPage() {
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel disabled={loading}>Cancelar</AlertDialogCancel>
<AlertDialogAction onClick={handleDelete} className="bg-red-600 hover:bg-red-700" disabled={loading}>
<AlertDialogAction onClick={handleDelete} className="bg-destructive hover:bg-destructive/90" disabled={loading}>
{loading ? <Loader2 className="w-4 h-4 mr-2 animate-spin" /> : null}
Excluir
</AlertDialogAction>
@ -484,7 +484,7 @@ export default function DoctorsPage() {
<AlertDialogTitle className="text-2xl">
{doctorDetails?.nome}
</AlertDialogTitle>
<AlertDialogDescription className="text-left text-gray-700">
<AlertDialogDescription className="text-left text-muted-foreground">
{doctorDetails && (
<div className="space-y-3 text-left">
<h3 className="font-semibold mt-2">
@ -537,7 +537,7 @@ export default function DoctorsPage() {
</div>
)}
{doctorDetails === null && !loading && (
<div className="text-red-600">Detalhes não disponíveis.</div>
<div className="text-destructive">Detalhes não disponíveis.</div>
)}
</AlertDialogDescription>
</AlertDialogHeader>

View File

@ -8,7 +8,7 @@ export default function ManagerLoginPage() {
// O ideal no futuro é deletar esta página e redirecionar os usuários.
return (
<div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-blue-50 flex items-center justify-center p-4">
<div className="min-h-screen bg-background flex items-center justify-center p-4">
<div className="w-full max-w-md text-center">
<h1 className="text-3xl font-bold text-foreground mb-2">Área do Gestor</h1>
<p className="text-muted-foreground mb-8">Acesse o sistema médico</p>

View File

@ -256,13 +256,13 @@ export default function EditarPacientePage() {
</Button>
</Link>
<div>
<h1 className="text-2xl font-bold text-gray-900">Editar Paciente</h1>
<p className="text-gray-600">Atualize as informações do paciente</p>
<h1 className="text-2xl font-bold text-foreground">Editar Paciente</h1>
<p className="text-muted-foreground">Atualize as informações do paciente</p>
</div>
{/* Anexos Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Anexos</h2>
<div className="bg-card rounded-lg border border-border p-6">
<h2 className="text-lg font-semibold text-foreground mb-6">Anexos</h2>
<div className="flex items-center gap-3 mb-4">
<input ref={anexoInputRef} type="file" className="hidden" />
<Button type="button" variant="outline" disabled={isUploadingAnexo}>
@ -270,16 +270,16 @@ export default function EditarPacientePage() {
</Button>
</div>
{anexos.length === 0 ? (
<p className="text-sm text-gray-500">Nenhum anexo encontrado.</p>
<p className="text-sm text-muted-foreground">Nenhum anexo encontrado.</p>
) : (
<ul className="divide-y">
<ul className="divide-y divide-border">
{anexos.map((a) => (
<li key={a.id} className="flex items-center justify-between py-2">
<div className="flex items-center gap-2 min-w-0">
<Paperclip className="w-4 h-4 text-gray-500 shrink-0" />
<span className="text-sm text-gray-800 truncate">{a.nome || a.filename || `Anexo ${a.id}`}</span>
<Paperclip className="w-4 h-4 text-muted-foreground shrink-0" />
<span className="text-sm text-foreground truncate">{a.nome || a.filename || `Anexo ${a.id}`}</span>
</div>
<Button type="button" variant="ghost" className="text-red-600">
<Button type="button" variant="ghost" className="text-destructive">
<Trash2 className="w-4 h-4 mr-1" /> Remover
</Button>
</li>
@ -290,20 +290,20 @@ export default function EditarPacientePage() {
</div>
<form onSubmit={handleSubmit} className="space-y-8">
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Dados Pessoais</h2>
<div className="bg-card rounded-lg border border-border p-6">
<h2 className="text-lg font-semibold text-foreground mb-6">Dados Pessoais</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{/* Photo upload */}
<div className="space-y-2">
<Label>Foto do paciente</Label>
<div className="flex items-center gap-4">
<div className="w-20 h-20 rounded-full bg-gray-100 overflow-hidden flex items-center justify-center">
<div className="w-20 h-20 rounded-full bg-muted overflow-hidden flex items-center justify-center">
{photoUrl ? (
// eslint-disable-next-line @next/next/no-img-element
<img src={photoUrl} alt="Foto do paciente" className="w-full h-full object-cover" />
) : (
<span className="text-gray-400 text-sm">Sem foto</span>
<span className="text-muted-foreground text-sm">Sem foto</span>
)}
</div>
<div className="flex gap-2">
@ -338,11 +338,11 @@ export default function EditarPacientePage() {
<Label>Sexo *</Label>
<div className="flex gap-4">
<div className="flex items-center space-x-2">
<input type="radio" id="Masculino" name="sexo" value="Masculino" checked={formData.sexo === "Masculino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-blue-600" />
<input type="radio" id="Masculino" name="sexo" value="Masculino" checked={formData.sexo === "Masculino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-primary" />
<Label htmlFor="Masculino">Masculino</Label>
</div>
<div className="flex items-center space-x-2">
<input type="radio" id="Feminino" name="sexo" value="Feminino" checked={formData.sexo === "Feminino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-blue-600" />
<input type="radio" id="Feminino" name="sexo" value="Feminino" checked={formData.sexo === "Feminino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-primary" />
<Label htmlFor="Feminino">Feminino</Label>
</div>
</div>
@ -471,8 +471,8 @@ export default function EditarPacientePage() {
</div>
{/* Contact Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Contato</h2>
<div className="bg-card rounded-lg border border-border p-6">
<h2 className="text-lg font-semibold text-foreground mb-6">Contato</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="space-y-2">
@ -498,8 +498,8 @@ export default function EditarPacientePage() {
</div>
{/* Address Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Endereço</h2>
<div className="bg-card rounded-lg border border-border p-6">
<h2 className="text-lg font-semibold text-foreground mb-6">Endereço</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div className="space-y-2">
@ -573,8 +573,8 @@ export default function EditarPacientePage() {
</div>
{/* Medical Information Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Informações Médicas</h2>
<div className="bg-card rounded-lg border border-border p-6">
<h2 className="text-lg font-semibold text-foreground mb-6">Informações Médicas</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="space-y-2">
@ -619,8 +619,8 @@ export default function EditarPacientePage() {
</div>
{/* Insurance Information Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Informações de convênio</h2>
<div className="bg-card rounded-lg border border-border p-6">
<h2 className="text-lg font-semibold text-foreground mb-6">Informações de convênio</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="space-y-2">
@ -669,7 +669,7 @@ export default function EditarPacientePage() {
Cancelar
</Button>
</Link>
<Button type="submit" className="bg-blue-600 hover:bg-blue-700">
<Button type="submit" className="bg-primary hover:bg-primary/90">
<Save className="w-4 h-4 mr-2" />
Salvar Alterações
</Button>

View File

@ -142,7 +142,7 @@ export default function PacientesPage() {
{/* Header */}
<div className="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
<div>
<h1 className="text-xl md:text-2xl font-bold text-foreground">
<h1 className="text-xl md:text-2xl font-bold">
Pacientes
</h1>
<p className="text-muted-foreground text-sm md:text-base">
@ -152,8 +152,8 @@ export default function PacientesPage() {
</div>
{/* Filtros */}
<div className="flex flex-wrap items-center gap-4 bg-card p-4 rounded-lg border border-border">
<Filter className="w-5 h-5 text-gray-400" />
<div className="flex flex-wrap items-center gap-4 bg-card p-4 rounded-lg border">
<Filter className="w-5 h-5 text-muted-foreground" />
{/* Busca */}
<input
@ -166,7 +166,7 @@ export default function PacientesPage() {
{/* Convênio */}
<div className="flex items-center gap-2 w-full sm:w-auto sm:flex-grow sm:max-w-[200px]">
<span className="text-sm font-medium text-foreground whitespace-nowrap hidden md:block">
<span className="text-sm font-medium whitespace-nowrap hidden md:block">
Convênio
</span>
<Select value={convenioFilter} onValueChange={setConvenioFilter}>
@ -184,7 +184,7 @@ export default function PacientesPage() {
{/* VIP */}
<div className="flex items-center gap-2 w-full sm:w-auto sm:flex-grow sm:max-w-[150px]">
<span className="text-sm font-medium text-foreground whitespace-nowrap hidden md:block">VIP</span>
<span className="text-sm font-medium whitespace-nowrap hidden md:block">VIP</span>
<Select value={vipFilter} onValueChange={setVipFilter}>
<SelectTrigger className="w-full sm:w-32">
<SelectValue placeholder="VIP" />
@ -219,32 +219,32 @@ export default function PacientesPage() {
</div>
{/* Tabela */}
<div className="bg-white rounded-lg border border-gray-200 shadow-md hidden md:block">
<div className="bg-card rounded-lg border shadow-md hidden md:block">
<div className="overflow-x-auto">
{error ? (
<div className="p-6 text-red-600">{`Erro ao carregar pacientes: ${error}`}</div>
<div className="p-6 text-destructive">{`Erro ao carregar pacientes: ${error}`}</div>
) : loading ? (
<div className="p-6 text-center text-gray-500 flex items-center justify-center">
<Loader2 className="w-6 h-6 mr-2 animate-spin text-green-600" />{" "}
<div className="p-6 text-center text-muted-foreground flex items-center justify-center">
<Loader2 className="w-6 h-6 mr-2 animate-spin text-primary" />{" "}
Carregando pacientes...
</div>
) : (
<table className="w-full min-w-[650px]">
<thead className="bg-gray-50 border-b border-gray-200">
<thead className="bg-muted border-b">
<tr>
<th className="text-left p-4 font-medium text-gray-700 w-[20%]">Nome</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden sm:table-cell">Telefone</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden md:table-cell">Cidade / Estado</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden sm:table-cell">Convênio</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden lg:table-cell">Último atendimento</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden lg:table-cell">Próximo atendimento</th>
<th className="text-left p-4 font-medium text-gray-700 w-[5%]">Ações</th>
<th className="text-left p-4 font-medium text-muted-foreground w-[20%]">Nome</th>
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden sm:table-cell">Telefone</th>
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden md:table-cell">Cidade / Estado</th>
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden sm:table-cell">Convênio</th>
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden lg:table-cell">Último atendimento</th>
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden lg:table-cell">Próximo atendimento</th>
<th className="text-left p-4 font-medium text-muted-foreground w-[5%]">Ações</th>
</tr>
</thead>
<tbody>
{currentPatients.length === 0 ? (
<tr>
<td colSpan={7} className="p-8 text-center text-gray-500">
<td colSpan={7} className="p-8 text-center text-muted-foreground">
{allPatients.length === 0
? "Nenhum paciente cadastrado"
: "Nenhum paciente encontrado com os filtros aplicados"}
@ -252,33 +252,33 @@ export default function PacientesPage() {
</tr>
) : (
currentPatients.map((patient) => (
<tr key={patient.id} className="border-b border-gray-100 hover:bg-gray-50">
<tr key={patient.id} className="border-b hover:bg-muted">
<td className="p-4">
<div className="flex items-center gap-3">
<div className="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center">
<span className="text-blue-600 font-medium text-sm">
<div className="w-8 h-8 bg-primary/10 rounded-full flex items-center justify-center">
<span className="text-primary font-medium text-sm">
{patient.nome?.charAt(0) || "?"}
</span>
</div>
<span className="font-medium text-gray-900">
<span className="font-medium">
{patient.nome}
{patient.vip && (
<span className="ml-2 px-2 py-0.5 text-xs font-semibold text-purple-600 bg-purple-100 rounded-full">
<span className="ml-2 px-2 py-0.5 text-xs font-semibold rounded-full text-purple-400 bg-purple-400/15 dark:text-purple-300 dark:bg-purple-300/15">
VIP
</span>
)}
</span>
</div>
</td>
<td className="p-4 text-gray-600 hidden sm:table-cell">{patient.telefone}</td>
<td className="p-4 text-gray-600 hidden md:table-cell">{`${patient.cidade} / ${patient.estado}`}</td>
<td className="p-4 text-gray-600 hidden sm:table-cell">{patient.convenio}</td>
<td className="p-4 text-gray-600 hidden lg:table-cell">{patient.ultimoAtendimento}</td>
<td className="p-4 text-gray-600 hidden lg:table-cell">{patient.proximoAtendimento}</td>
<td className="p-4 text-muted-foreground hidden sm:table-cell">{patient.telefone}</td>
<td className="p-4 text-muted-foreground hidden md:table-cell">{`${patient.cidade} / ${patient.estado}`}</td>
<td className="p-4 text-muted-foreground hidden sm:table-cell">{patient.convenio}</td>
<td className="p-4 text-muted-foreground hidden lg:table-cell">{patient.ultimoAtendimento}</td>
<td className="p-4 text-muted-foreground hidden lg:table-cell">{patient.proximoAtendimento}</td>
<td className="p-4">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<div className="text-black-600 cursor-pointer">
<div className="cursor-pointer">
<MoreVertical className="h-4 w-4" />
</div>
</DropdownMenuTrigger>
@ -297,7 +297,7 @@ export default function PacientesPage() {
<Calendar className="w-4 h-4 mr-2" />
Marcar consulta
</DropdownMenuItem>
<DropdownMenuItem className="text-red-600" onClick={() => openDeleteDialog(String(patient.id))}>
<DropdownMenuItem className="text-destructive" onClick={() => openDeleteDialog(String(patient.id))}>
<Trash2 className="w-4 h-4 mr-2" />
Excluir
</DropdownMenuItem>
@ -315,7 +315,7 @@ export default function PacientesPage() {
{/* Paginação */}
{totalPages > 1 && !loading && (
<div className="flex flex-col sm:flex-row items-center justify-center p-4 border-t border-gray-200">
<div className="flex flex-col sm:flex-row items-center justify-center p-4 border-t border-border">
<div className="flex space-x-2 flex-wrap justify-center">
<Button
onClick={() => setPage((prev) => Math.max(1, prev - 1))}
@ -335,8 +335,8 @@ export default function PacientesPage() {
size="lg"
className={
pageNumber === page
? "bg-blue-600 hover:bg-blue-700 text-white"
: "text-gray-700"
? "bg-primary hover:bg-primary/90 text-primary-foreground"
: "text-muted-foreground"
}
>
{pageNumber}
@ -367,7 +367,7 @@ export default function PacientesPage() {
<AlertDialogCancel>Cancelar</AlertDialogCancel>
<AlertDialogAction
onClick={() => patientToDelete && handleDeletePatient(patientToDelete)}
className="bg-red-600 hover:bg-red-700"
className="bg-destructive hover:bg-destructive/90"
>
Excluir
</AlertDialogAction>
@ -382,12 +382,12 @@ export default function PacientesPage() {
<AlertDialogTitle>Detalhes do Paciente</AlertDialogTitle>
<AlertDialogDescription>
{patientDetails === null ? (
<div className="text-gray-500">
<Loader2 className="w-6 h-6 animate-spin mx-auto text-green-600 my-4" />
<div className="text-muted-foreground">
<Loader2 className="w-6 h-6 animate-spin mx-auto text-primary my-4" />
Carregando...
</div>
) : patientDetails?.error ? (
<div className="text-red-600 p-4">{patientDetails.error}</div>
<div className="text-destructive p-4">{patientDetails.error}</div>
) : (
<div className="grid gap-4 py-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">

View File

@ -155,12 +155,12 @@ export default function EditarUsuarioPage() {
if (loading) {
return (
<Sidebar>
<div className="flex justify-center items-center h-full w-full py-16">
<Loader2 className="w-8 h-8 animate-spin text-green-600" />
<p className="ml-2 text-gray-600">Carregando dados do usuário...</p>
</div>
</Sidebar>
<Sidebar>
<div className="flex justify-center items-center h-full w-full py-16">
<Loader2 className="w-8 h-8 animate-spin text-primary" />
<p className="ml-2 text-muted-foreground">Carregando dados do usuário...</p>
</div>
</Sidebar>
);
}
@ -169,10 +169,10 @@ export default function EditarUsuarioPage() {
<div className="w-full max-w-2xl mx-auto space-y-6 p-4 md:p-8">
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold text-gray-900">
Editar Usuário: <span className="text-green-600">{formData.nomeCompleto}</span>
<h1 className="text-2xl font-bold text-foreground">
Editar Usuário: <span className="text-primary">{formData.nomeCompleto}</span>
</h1>
<p className="text-sm text-gray-500">
<p className="text-sm text-muted-foreground">
Atualize as informações do usuário (ID: {id}).
</p>
</div>
@ -184,9 +184,9 @@ export default function EditarUsuarioPage() {
</Link>
</div>
<form onSubmit={handleSubmit} className="space-y-8 bg-white p-8 border rounded-lg shadow-sm">
<form onSubmit={handleSubmit} className="space-y-8 bg-card p-8 border border-border rounded-lg shadow-sm">
{error && (
<div className="p-3 bg-red-100 text-red-700 rounded-lg border border-red-300">
<div className="p-3 rounded-lg border bg-destructive/10 text-destructive border-destructive/30">
<p className="font-medium">Erro na Atualização:</p>
<p className="text-sm">{error}</p>
</div>
@ -261,7 +261,7 @@ export default function EditarUsuarioPage() {
</Link>
<Button
type="submit"
className="bg-green-600 hover:bg-green-700"
className="bg-primary hover:bg-primary/90"
disabled={isSaving}
>
{isSaving ? (

View File

@ -140,17 +140,17 @@ export default function NovoUsuarioPage() {
<div className="w-full max-w-screen-lg space-y-8">
<div className="flex items-center justify-between border-b pb-4">
<div>
<h1 className="text-3xl font-extrabold text-gray-900">Novo Usuário</h1>
<p className="text-md text-gray-500">Preencha os dados para cadastrar um novo usuário no sistema.</p>
<h1 className="text-3xl font-extrabold">Novo Usuário</h1>
<p className="text-md text-muted-foreground">Preencha os dados para cadastrar um novo usuário no sistema.</p>
</div>
<Link href="/manager/usuario">
<Button variant="outline">Cancelar</Button>
</Link>
</div>
<form onSubmit={handleSubmit} className="space-y-6 bg-white p-6 md:p-10 border rounded-xl shadow-lg">
<form onSubmit={handleSubmit} className="space-y-6 bg-card p-6 md:p-10 border rounded-xl shadow-lg">
{error && (
<div className="p-4 bg-red-50 text-red-700 rounded-lg border border-red-300">
<div className="p-4 bg-destructive/10 text-destructive rounded-lg border border-destructive">
<p className="font-semibold">Erro no Cadastro:</p>
<p className="text-sm break-words">{error}</p>
</div>
@ -208,7 +208,7 @@ export default function NovoUsuarioPage() {
<div className="space-y-2">
<Label htmlFor="confirmarSenha">Confirmar Senha *</Label>
<Input id="confirmarSenha" type="password" value={formData.confirmarSenha} onChange={(e) => handleInputChange("confirmarSenha", e.target.value)} placeholder="Repita a senha" required />
{formData.senha && formData.confirmarSenha && formData.senha !== formData.confirmarSenha && <p className="text-xs text-red-500">As senhas não coincidem.</p>}
{formData.senha && formData.confirmarSenha && formData.senha !== formData.confirmarSenha && <p className="text-xs text-destructive">As senhas não coincidem.</p>}
</div>
<div className="space-y-2">
@ -228,7 +228,7 @@ export default function NovoUsuarioPage() {
Cancelar
</Button>
</Link>
<Button type="submit" className="bg-green-600 hover:bg-green-700" disabled={isSaving}>
<Button type="submit" className="bg-primary hover:bg-primary/90" disabled={isSaving}>
{isSaving ? <Loader2 className="w-4 h-4 mr-2 animate-spin" /> : <Save className="w-4 h-4 mr-2" />}
{isSaving ? "Salvando..." : "Salvar Usuário"}
</Button>

View File

@ -182,22 +182,22 @@ export default function UsersPage() {
{/* Header */}
<div className="flex flex-wrap items-center justify-between gap-3">
<div>
<h1 className="text-2xl font-bold text-gray-900">Usuários</h1>
<p className="text-sm text-gray-500">Gerencie usuários.</p>
<h1 className="text-2xl font-bold">Usuários</h1>
<p className="text-sm text-muted-foreground">Gerencie usuários.</p>
</div>
<Link href="/manager/usuario/novo" className="w-full sm:w-auto">
<Button className="w-full sm:w-auto bg-blue-600 hover:bg-blue-700">
<Button className="w-full sm:w-auto">
<Plus className="w-4 h-4 mr-2" /> Novo Usuário
</Button>
</Link>
</div>
{/* --- 4. Filtro (Barra de Pesquisa + Selects) --- */}
<div className="flex flex-col md:flex-row items-start md:items-center gap-3 bg-white p-4 rounded-lg border border-gray-200">
<div className="flex flex-col md:flex-row items-start md:items-center gap-3 bg-card p-4 rounded-lg border">
{/* Barra de Pesquisa */}
<div className="relative w-full md:flex-1">
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400" />
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input
placeholder="Buscar por nome, e-mail ou telefone..."
value={searchTerm}
@ -205,7 +205,7 @@ export default function UsersPage() {
setSearchTerm(e.target.value);
setCurrentPage(1); // Reseta a paginação ao pesquisar
}}
className="pl-10 w-full bg-gray-50 border-gray-200 focus:bg-white transition-colors"
className="pl-10 w-full bg-muted border-border focus:bg-card transition-colors"
/>
</div>
@ -259,54 +259,54 @@ export default function UsersPage() {
{/* Fim do Filtro */}
{/* Tabela/Lista */}
<div className="bg-white rounded-lg border border-gray-200 shadow-md overflow-x-auto">
<div className="bg-card rounded-lg border shadow-md overflow-x-auto">
{loading ? (
<div className="p-8 text-center text-gray-500">
<Loader2 className="w-8 h-8 animate-spin mx-auto mb-3 text-green-600" />
<div className="p-8 text-center text-muted-foreground">
<Loader2 className="w-8 h-8 animate-spin mx-auto mb-3 text-primary" />
Carregando usuários...
</div>
) : error ? (
<div className="p-8 text-center text-red-600">{error}</div>
<div className="p-8 text-center text-destructive">{error}</div>
) : filteredUsers.length === 0 ? (
<div className="p-8 text-center text-gray-500">
<div className="p-8 text-center text-muted-foreground">
Nenhum usuário encontrado com os filtros aplicados.
</div>
) : (
<>
{/* Tabela para Telas Médias e Grandes */}
<table className="min-w-full divide-y divide-gray-200 hidden md:table">
<thead className="bg-gray-50">
<table className="min-w-full divide-y hidden md:table">
<thead className="bg-muted">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">
<th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase">
Nome
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">
<th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase">
E-mail
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">
<th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase">
Telefone
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">
<th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase">
Cargo
</th>
<th className="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase">
<th className="px-6 py-3 text-right text-xs font-medium text-muted-foreground uppercase">
Ações
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
<tbody className="bg-card divide-y">
{currentItems.map((u) => (
<tr key={u.id} className="hover:bg-gray-50">
<td className="px-6 py-4 text-sm text-gray-900">
<tr key={u.id} className="hover:bg-muted">
<td className="px-6 py-4 text-sm">
{u.full_name}
</td>
<td className="px-6 py-4 text-sm text-gray-500 break-all">
<td className="px-6 py-4 text-sm text-muted-foreground break-all">
{u.email}
</td>
<td className="px-6 py-4 text-sm text-gray-500">
<td className="px-6 py-4 text-sm text-muted-foreground">
{u.phone}
</td>
<td className="px-6 py-4 text-sm text-gray-500 capitalize">
<td className="px-6 py-4 text-sm text-muted-foreground capitalize">
{u.role}
</td>
<td className="px-6 py-4 text-right">
@ -325,17 +325,17 @@ export default function UsersPage() {
</table>
{/* Layout em Cards/Lista para Telas Pequenas */}
<div className="md:hidden divide-y divide-gray-200">
<div className="md:hidden divide-y">
{currentItems.map((u) => (
<div key={u.id} className="flex items-center justify-between p-4 hover:bg-gray-50">
<div key={u.id} className="flex items-center justify-between p-4 hover:bg-muted">
<div className="flex-1 min-w-0">
<div className="text-sm font-medium text-gray-900 truncate">
<div className="text-sm font-medium truncate">
{u.full_name || "—"}
</div>
<div className="text-xs text-gray-500 truncate">
<div className="text-xs text-muted-foreground truncate">
{u.email}
</div>
<div className="text-sm text-gray-500 capitalize mt-1">
<div className="text-sm text-muted-foreground capitalize mt-1">
{u.role || "—"}
</div>
</div>
@ -355,12 +355,12 @@ export default function UsersPage() {
{/* Paginação */}
{totalPages > 1 && (
<div className="flex flex-wrap justify-center items-center gap-2 mt-4 p-4 border-t border-gray-200">
<div className="flex flex-wrap justify-center items-center gap-2 mt-4 p-4 border-t">
{/* Botão Anterior */}
<button
onClick={goToPrevPage}
disabled={currentPage === 1}
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed border border-gray-300"
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-muted text-muted-foreground hover:bg-muted/90 disabled:opacity-50 disabled:cursor-not-allowed border"
>
{"< Anterior"}
</button>
@ -370,10 +370,10 @@ export default function UsersPage() {
<button
key={number}
onClick={() => paginate(number)}
className={`px-4 py-2 rounded-md font-medium transition-colors text-sm border border-gray-300 ${
className={`px-4 py-2 rounded-md font-medium transition-colors text-sm border ${
currentPage === number
? "bg-blue-600 text-white shadow-md border-blue-600"
: "bg-gray-100 text-gray-700 hover:bg-gray-200"
? "bg-primary text-primary-foreground shadow-md border-primary"
: "bg-muted text-muted-foreground hover:bg-muted/90"
}`}
>
{number}
@ -384,7 +384,7 @@ export default function UsersPage() {
<button
onClick={goToNextPage}
disabled={currentPage === totalPages}
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed border border-gray-300"
className="flex items-center px-4 py-2 rounded-md font-medium transition-colors text-sm bg-muted text-muted-foreground hover:bg-muted/90 disabled:opacity-50 disabled:cursor-not-allowed border"
>
{"Próximo >"}
</button>
@ -406,12 +406,12 @@ export default function UsersPage() {
</AlertDialogTitle>
<AlertDialogDescription>
{!userDetails ? (
<div className="p-4 text-center text-gray-500">
<Loader2 className="w-6 h-6 animate-spin mx-auto mb-3 text-green-600" />
<div className="p-4 text-center text-muted-foreground">
<Loader2 className="w-6 h-6 animate-spin mx-auto mb-3 text-primary" />
Buscando dados completos...
</div>
) : (
<div className="space-y-3 pt-2 text-left text-gray-700">
<div className="space-y-3 pt-2 text-left text-muted-foreground">
<div>
<strong>ID:</strong> {userDetails.user.id}
</div>
@ -437,7 +437,7 @@ export default function UsersPage() {
{k}:{" "}
<span
className={`font-semibold ${
v ? "text-green-600" : "text-red-600"
v ? "text-primary" : "text-destructive"
}`}
>
{v ? "Sim" : "Não"}

View File

@ -4,28 +4,34 @@ import Link from "next/link";
import { Button } from "@/components/ui/button";
import { useState } from "react";
import { Stethoscope, Baby, Microscope } from "lucide-react";
import { useAccessibility } from "./context/AccessibilityContext";
export default function InicialPage() {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const { contrast } = useAccessibility();
const heroClass = contrast === "high"
? "px-6 md:px-10 lg:px-20 py-20 bg-background text-foreground border-y-2 border-primary"
: "px-6 md:px-10 lg:px-20 py-20 bg-gradient-to-r from-[#1E2A78] via-[#007BFF] to-[#00BFFF] text-white";
return (
<div className="min-h-screen flex flex-col bg-white font-sans scroll-smooth text-[#1E2A78]">
<div className="min-h-screen flex flex-col bg-background font-sans scroll-smooth text-foreground">
{/* Barra superior */}
<div className="bg-[#1E2A78] text-white text-sm py-2 px-4 md:px-6 flex justify-between items-center">
<div className="bg-primary text-primary-foreground text-sm py-2 px-4 md:px-6 flex justify-between items-center">
<span className="hidden sm:inline">Horário: 08h00 - 21h00</span>
<span className="hover:underline cursor-pointer transition">
Email: contato@mediconnect.com
</span>
</div>
{/* Header */}
<header className="bg-white shadow-md py-4 px-4 md:px-6 flex justify-between items-center relative sticky top-0 z-50 backdrop-blur-md">
<header className="bg-muted text-foreground shadow-md py-4 px-4 md:px-6 flex justify-between items-center relative sticky top-0 z-50 backdrop-blur-md">
<a href="#home" className="flex items-center space-x-2 cursor-pointer">
<img
src="/android-chrome-512x512.png"
alt="Logo MediConnect"
className="w-20 h-20 object-contain transition-transform hover:scale-105"
/>
<h1 className="text-2xl font-extrabold text-[#1E2A78] tracking-tight">
<h1 className="text-2xl font-extrabold text-foreground tracking-tight">
MedConnect
</h1>
</a>
@ -35,7 +41,7 @@ export default function InicialPage() {
<Link href="/login">
<Button
variant="outline"
className="rounded-full px-4 py-2 text-sm border-2 border-[#007BFF] text-[#007BFF] hover:bg-[#007BFF] hover:text-white transition"
className="rounded-full px-4 py-2 text-sm border-2 border-primary text-primary hover:bg-primary hover:text-primary-foreground transition"
>
Login
</Button>
@ -76,20 +82,20 @@ export default function InicialPage() {
isMenuOpen ? "block" : "hidden"
} absolute top-[76px] left-0 w-full bg-white shadow-md py-4 md:relative md:top-auto md:left-auto md:w-auto md:block md:bg-transparent md:shadow-none transition-all duration-300 z-10`}
>
<div className="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-8 text-gray-600 font-medium items-center">
<Link href="#home" className="hover:text-[#007BFF] transition">
<div className="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-8 text-foreground font-medium items-center">
<Link href="#home" className="hover:text-primary transition">
Home
</Link>
<a href="#about" className="hover:text-[#007BFF] transition">
<a href="#about" className="hover:text-primary transition">
Sobre
</a>
<a href="#departments" className="hover:text-[#007BFF] transition">
<a href="#departments" className="hover:text-primary transition">
Departamentos
</a>
<a href="#doctors" className="hover:text-[#007BFF] transition">
<a href="#doctors" className="hover:text-primary transition">
Médicos
</a>
<a href="#contact" className="hover:text-[#007BFF] transition">
<a href="#contact" className="hover:text-primary transition">
Contato
</a>
</div>
@ -100,7 +106,7 @@ export default function InicialPage() {
<Link href="/login">
<Button
variant="outline"
className="rounded-full px-6 py-2 border-2 border-[#007BFF] text-[#007BFF] hover:bg-[#007BFF] hover:text-white transition cursor-pointer"
className="rounded-full px-6 py-2 border-2 border-primary text-primary hover:bg-primary hover:text-primary-foreground transition cursor-pointer"
>
Login
</Button>
@ -108,7 +114,7 @@ export default function InicialPage() {
</div>
</header>
{/* Hero Section */}
<section className="flex flex-col md:flex-row items-center justify-between px-6 md:px-10 lg:px-20 py-20 bg-gradient-to-r from-[#1E2A78] via-[#007BFF] to-[#00BFFF] text-white">
<section className={`flex flex-col md:flex-row items-center justify-between ${heroClass}`}>
<div className="max-w-lg mx-auto md:mx-0">
<h2 className="uppercase text-sm tracking-widest opacity-80">
Bem-vindo à Saúde Digital
@ -116,15 +122,15 @@ export default function InicialPage() {
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-extrabold leading-tight mt-2 drop-shadow-lg">
Soluções Médicas <br /> & Cuidados com a Saúde
</h1>
<p className="mt-4 text-base leading-relaxed opacity-90">
<p className="mt-4 text-base leading-relaxed opacity-90 text-foreground">
Excelência em saúde mais de 25 anos. Atendimento médico com
qualidade, segurança e carinho.
</p>
<div className="mt-8 flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4 justify-center md:justify-start">
<Button className="px-8 py-3 text-base font-semibold bg-white text-[#1E2A78] hover:bg-[#EAF4FF] transition-all shadow-md">
<Button className="px-8 py-3 text-base font-semibold bg-card text-card-foreground hover:bg-muted transition-all shadow-md">
Nossos Serviços
</Button>
<Button className="px-8 py-3 text-base font-semibold bg-white text-[#1E2A78] hover:bg-[#EAF4FF] transition-all shadow-md">
<Button className="px-8 py-3 text-base font-semibold bg-card text-card-foreground hover:bg-muted transition-all shadow-md">
Saiba Mais
</Button>
</div>
@ -140,12 +146,12 @@ export default function InicialPage() {
{/* Serviços */}
<section
id="departments"
className="py-20 px-6 md:px-10 lg:px-20 bg-[#F8FBFF]"
className="py-20 px-6 md:px-10 lg:px-20 bg-secondary"
>
<h2 className="text-center text-3xl sm:text-4xl font-extrabold text-[#1E2A78]">
<h2 className="text-center text-3xl sm:text-4xl font-extrabold text-foreground">
Cuidados completos para a sua saúde
</h2>
<p className="text-center text-gray-600 mt-3 text-base">
<p className="text-center text-muted-foreground mt-3 text-base">
Serviços médicos que oferecemos
</p>
@ -170,16 +176,16 @@ export default function InicialPage() {
].map(({ title, desc, Icon }, index) => (
<div
key={index}
className="p-8 bg-white rounded-2xl shadow-md hover:shadow-xl transition-all duration-300 border border-[#E0E9FF] group"
className="p-8 bg-card rounded-2xl shadow-md hover:shadow-xl transition-all duration-300 border border-border group"
>
<div className="flex items-center space-x-3">
<Icon className="text-[#007BFF] w-6 h-6 group-hover:scale-110 transition-transform" />
<Icon className="text-primary w-6 h-6 group-hover:scale-110 transition-transform" />
<h3 className="text-xl font-semibold">{title}</h3>
</div>
<p className="text-gray-600 mt-3 text-sm leading-relaxed">
<p className="text-muted-foreground mt-3 text-sm leading-relaxed">
{desc}
</p>
<Button className="mt-6 w-full bg-[#007BFF] hover:bg-[#005FCC] text-white transition">
<Button className="mt-6 w-full bg-primary hover:opacity-90 text-primary-foreground transition">
Agendar
</Button>
</div>
@ -187,17 +193,17 @@ export default function InicialPage() {
</div>
</section>
{/* Footer */}
<footer className="bg-[#1E2A78] text-white py-8 text-center text-sm">
<footer className="bg-primary text-primary-foreground py-8 text-center text-sm border-t-2 border-primary-foreground/20">
<div className="space-y-2">
<p>© 2025 MediConnect Todos os direitos reservados</p>
<div className="flex justify-center space-x-6 opacity-80">
<a href="#about" className="hover:text-[#00BFFF] transition">
<div className="flex justify-center space-x-6 opacity-90">
<a href="#about" className="hover:opacity-70 transition">
Sobre
</a>
<a href="#departments" className="hover:text-[#00BFFF] transition">
<a href="#departments" className="hover:opacity-70 transition">
Serviços
</a>
<a href="#contact" className="hover:text-[#00BFFF] transition">
<a href="#contact" className="hover:opacity-70 transition">
Contato
</a>
</div>

View File

@ -142,7 +142,7 @@ export default function PatientAppointmentsPage() {
{isLoading ? (
<p>Carregando consultas...</p>
) : appointments.length === 0 ? (
<p className="text-gray-600">Você ainda não possui consultas agendadas.</p>
<p className="text-muted-foreground">Você ainda não possui consultas agendadas.</p>
) : (
appointments.map((apt) => (
<Card key={apt.id}>
@ -153,14 +153,14 @@ export default function PatientAppointmentsPage() {
</div>
{getStatusBadge(apt.status)}
</CardHeader>
<CardContent className="grid md:grid-cols-2 gap-3 text-sm text-gray-700">
<CardContent className="grid md:grid-cols-2 gap-3 text-sm text-muted-foreground">
<div className="space-y-2">
<div className="flex items-center">
<Calendar className="mr-2 h-4 w-4 text-gray-500" />
<Calendar className="mr-2 h-4 w-4 text-muted-foreground" />
{new Date(apt.scheduled_at).toLocaleDateString("pt-BR")}
</div>
<div className="flex items-center">
<Clock className="mr-2 h-4 w-4 text-gray-500" />
<Clock className="mr-2 h-4 w-4 text-muted-foreground" />
{new Date(apt.scheduled_at).toLocaleTimeString("pt-BR", {
hour: "2-digit",
minute: "2-digit",

View File

@ -15,8 +15,8 @@ export default function PatientDashboard() {
<Sidebar>
<div className="space-y-6">
<div>
<h1 className="text-3xl font-bold text-gray-900">Dashboard</h1>
<p className="text-gray-600">
<h1 className="text-3xl font-bold text-foreground">Dashboard</h1>
<p className="text-muted-foreground">
Bem-vindo ao seu portal de consultas médicas
</p>
</div>
@ -72,15 +72,15 @@ export default function PatientDashboard() {
</CardHeader>
<CardContent className="space-y-4">
<Link href="/patient/schedule">
<Button className="w-full justify-start bg-blue-600 text-white hover:bg-blue-700">
<User className="mr-2 h-4 w-4 text-white" />
<Button className="w-full justify-start">
<User className="mr-2 h-4 w-4" />
Agendar Nova Consulta
</Button>
</Link>
<Link href="/patient/appointments">
<Button
variant="outline"
className="w-full justify-start bg-transparent bg-blue-600 hover:bg-blue-700 text-white"
variant="secondary"
className="w-full justify-start"
>
<Calendar className="mr-2 h-4 w-4" />
Ver Minhas Consultas
@ -89,7 +89,7 @@ export default function PatientDashboard() {
<Link href="/patient/profile">
<Button
variant="outline"
className="w-full justify-start bg-transparent"
className="w-full justify-start"
>
<User className="mr-2 h-4 w-4" />
Atualizar Dados
@ -105,24 +105,24 @@ export default function PatientDashboard() {
</CardHeader>
<CardContent>
<div className="space-y-4">
<div className="flex items-center justify-between p-3 bg-blue-50 rounded-lg">
<div className="flex items-center justify-between p-3 bg-muted rounded-lg">
<div>
<p className="font-medium">Dr. Silva</p>
<p className="text-sm text-gray-600">Cardiologia</p>
<p className="text-sm text-muted-foreground">Cardiologia</p>
</div>
<div className="text-right">
<p className="font-medium">15 Jan</p>
<p className="text-sm text-gray-600">14:30</p>
<p className="text-sm text-muted-foreground">14:30</p>
</div>
</div>
<div className="flex items-center justify-between p-3 bg-green-50 rounded-lg">
<div className="flex items-center justify-between p-3 bg-muted rounded-lg">
<div>
<p className="font-medium">Dra. Santos</p>
<p className="text-sm text-gray-600">Dermatologia</p>
<p className="text-sm text-muted-foreground">Dermatologia</p>
</div>
<div className="text-right">
<p className="font-medium">22 Jan</p>
<p className="text-sm text-gray-600">10:00</p>
<p className="text-sm text-muted-foreground">10:00</p>
</div>
</div>
</div>

View File

@ -164,8 +164,8 @@ export default function PatientProfile() {
<div className="space-y-6">
<div className="flex justify-between items-center">
<div>
<h1 className="text-3xl font-bold text-gray-900">Meus Dados</h1>
<p className="text-gray-600">Gerencie suas informações pessoais</p>
<h1 className="text-3xl font-bold text-foreground">Meus Dados</h1>
<p className="text-muted-foreground">Gerencie suas informações pessoais</p>
</div>
<Button
onClick={() => (isEditing ? handleSave() : setIsEditing(true))}
@ -342,20 +342,20 @@ export default function PatientProfile() {
</div>
<div>
<p className="font-medium">{patientData.name}</p>
<p className="text-sm text-gray-500">Paciente</p>
<p className="text-sm text-muted-foreground">Paciente</p>
</div>
</div>
<div className="space-y-3 pt-4 border-t">
<div className="flex items-center text-sm">
<Mail className="mr-2 h-4 w-4 text-gray-500" />
<Mail className="mr-2 h-4 w-4 text-muted-foreground" />
<span className="truncate">{patientData.email}</span>
</div>
<div className="flex items-center text-sm">
<Phone className="mr-2 h-4 w-4 text-gray-500" />
<Phone className="mr-2 h-4 w-4 text-muted-foreground" />
<span>{patientData.phone || "Não informado"}</span>
</div>
<div className="flex items-center text-sm">
<Calendar className="mr-2 h-4 w-4 text-gray-500" />
<Calendar className="mr-2 h-4 w-4 text-muted-foreground" />
<span>
{patientData.birthDate
? new Date(patientData.birthDate).toLocaleDateString(

View File

@ -85,19 +85,18 @@ export default function PatientRegister() {
}
return (
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 py-8 px-4">
<div className="min-h-screen bg-background py-8 px-4">
<div className="max-w-2xl mx-auto">
<div className="mb-6">
<Link href="/" className="inline-flex items-center text-blue-600 hover:text-blue-800">
<Link href="/" className="inline-flex items-center text-primary hover:text-primary/90">
<ArrowLeft className="w-4 h-4 mr-2" />
Voltar ao início
</Link>
</div>
<Card>
<CardHeader className="text-center">
<CardTitle className="text-2xl">Crie sua Conta de Paciente</CardTitle>
<CardDescription>Preencha seus dados para acessar o portal MedConnect</CardDescription>
<CardTitle className="text-2xl text-foreground">Crie sua Conta de Paciente</CardTitle>
<CardDescription className="text-muted-foreground">Preencha seus dados para acessar o portal MedConnect</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleRegister} className="space-y-4">
@ -172,9 +171,9 @@ export default function PatientRegister() {
</form>
<div className="mt-6 text-center">
<p className="text-sm text-gray-600">
tem uma conta?{" "}
<Link href="/login" className="text-blue-600 hover:underline">
<p className="text-sm">
<span className="text-muted-foreground"> tem uma conta?</span>{" "}
<Link href="/login" className="text-primary hover:underline font-medium">
Faça login aqui
</Link>
</p>

View File

@ -131,8 +131,8 @@ export default function ReportsPage() {
<Sidebar>
<div className="space-y-6">
<div>
<h1 className="text-3xl font-bold text-gray-900">Meus Laudos</h1>
<p className="text-gray-600 mt-2">Visualize e baixe seus laudos médicos e resultados de exames</p>
<h1 className="text-3xl font-bold text-foreground">Meus Laudos</h1>
<p className="text-muted-foreground mt-2">Visualize e baixe seus laudos médicos e resultados de exames</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
@ -167,7 +167,7 @@ export default function ReportsPage() {
{availableReports.length > 0 && (
<div>
<h2 className="text-xl font-semibold text-gray-900 mb-4">Laudos Disponíveis</h2>
<h2 className="text-xl font-semibold text-foreground mb-4">Laudos Disponíveis</h2>
<div className="grid gap-4">
{availableReports.map((report) => (
<Card key={report.id} className="hover:shadow-md transition-shadow">
@ -192,7 +192,7 @@ export default function ReportsPage() {
</div>
</CardHeader>
<CardContent>
<p className="text-gray-600 mb-4">{report.diagnosis}</p>
<p className="text-muted-foreground mb-4">{report.diagnosis}</p>
<div className="flex gap-2">
<Button
variant="outline"
@ -222,7 +222,7 @@ export default function ReportsPage() {
{pendingReports.length > 0 && (
<div>
<h2 className="text-xl font-semibold text-gray-900 mb-4">Laudos Pendentes</h2>
<h2 className="text-xl font-semibold text-foreground mb-4">Laudos Pendentes</h2>
<div className="grid gap-4">
{pendingReports.map((report) => (
<Card key={report.id} className="opacity-75">
@ -247,8 +247,8 @@ export default function ReportsPage() {
</div>
</CardHeader>
<CardContent>
<p className="text-gray-600 mb-4">{report.diagnosis}</p>
<p className="text-sm text-yellow-600 font-medium">
<p className="text-muted-foreground mb-4">{report.diagnosis}</p>
<p className="text-sm text-yellow-600 dark:text-yellow-500 font-medium">
Laudo em processamento. Você será notificado quando estiver disponível.
</p>
</CardContent>
@ -261,9 +261,9 @@ export default function ReportsPage() {
{reports.length === 0 && !isLoading && (
<Card className="text-center py-12">
<CardContent>
<FileText className="h-12 w-12 text-gray-400 mx-auto mb-4" />
<h3 className="text-lg font-medium text-gray-900 mb-2">Nenhum laudo encontrado</h3>
<p className="text-gray-600">Seus laudos médicos aparecerão aqui após a realização de exames.</p>
<FileText className="h-12 w-12 text-muted-foreground mx-auto mb-4" />
<h3 className="text-lg font-medium text-foreground mb-2">Nenhum laudo encontrado</h3>
<p className="text-muted-foreground">Seus laudos médicos aparecerão aqui após a realização de exames.</p>
</CardContent>
</Card>
)}

18
app/providers.tsx Normal file
View File

@ -0,0 +1,18 @@
"use client";
import { AccessibilityProvider } from "./context/AccessibilityContext";
import { AppointmentsProvider } from "./context/AppointmentsContext";
import { AccessibilityModal } from "@/components/accessibility-modal";
import { ThemeInitializer } from "@/components/theme-initializer";
export function Providers({ children }: { children: React.ReactNode }) {
return (
<>
<ThemeInitializer />
<AccessibilityProvider>
<AppointmentsProvider>{children}</AppointmentsProvider>
<AccessibilityModal />
</AccessibilityProvider>
</>
);
}

View File

@ -156,31 +156,6 @@ export default function SecretaryAppointments() {
}
};
const getStatusBadge = (status: string) => {
switch (status) {
case "requested":
return (
<Badge className="bg-yellow-100 text-yellow-800">Solicitada</Badge>
);
case "confirmed":
return <Badge className="bg-blue-100 text-blue-800">Confirmada</Badge>;
case "checked_in":
return (
<Badge className="bg-indigo-100 text-indigo-800">Check-in</Badge>
);
case "completed":
return <Badge className="bg-green-100 text-green-800">Realizada</Badge>;
case "cancelled":
return <Badge className="bg-red-100 text-red-800">Cancelada</Badge>;
case "no_show":
return (
<Badge className="bg-gray-100 text-gray-800">Não Compareceu</Badge>
);
default:
return <Badge variant="secondary">{status}</Badge>;
}
};
const timeSlots = [
"08:00",
"08:30",
@ -213,14 +188,14 @@ export default function SecretaryAppointments() {
<div className="space-y-6">
<div className="flex justify-between items-center">
<div>
<h1 className="text-3xl font-bold text-gray-900">
<h1 className="text-3xl font-bold">
Consultas Agendadas
</h1>
<p className="text-gray-600">Gerencie as consultas dos pacientes</p>
<p className="text-muted-foreground">Gerencie as consultas dos pacientes</p>
</div>
<Link href="/secretary/schedule">
<Button className="bg-blue-600 hover:bg-blue-700 text-white">
<Calendar className="mr-2 h-4 w-4 text-white" />
<Button className="bg-primary hover:bg-primary/90 text-primary-foreground">
<Calendar className="mr-2 h-4 w-4" />
Agendar Nova Consulta
</Button>
</Link>
@ -248,18 +223,18 @@ export default function SecretaryAppointments() {
<CardContent>
<div className="grid md:grid-cols-2 gap-4">
<div className="space-y-3">
<div className="flex items-center text-sm text-gray-800 font-medium">
<User className="mr-2 h-4 w-4 text-gray-600" />
<div className="flex items-center text-sm text-foreground font-medium">
<User className="mr-2 h-4 w-4 text-muted-foreground" />
{appointment.patient.full_name}
</div>
<div className="flex items-center text-sm text-gray-600">
<div className="flex items-center text-sm text-muted-foreground">
<Calendar className="mr-2 h-4 w-4" />
{new Date(appointment.scheduled_at).toLocaleDateString(
"pt-BR",
{ timeZone: "UTC" }
)}
</div>
<div className="flex items-center text-sm text-gray-600">
<div className="flex items-center text-sm text-muted-foreground">
<Clock className="mr-2 h-4 w-4" />
{new Date(appointment.scheduled_at).toLocaleTimeString(
"pt-BR",
@ -272,11 +247,11 @@ export default function SecretaryAppointments() {
</div>
</div>
<div className="space-y-3">
<div className="flex items-center text-sm text-gray-600">
<div className="flex items-center text-sm text-muted-foreground">
<MapPin className="mr-2 h-4 w-4" />
{appointment.doctor.location || "Local a definir"}
</div>
<div className="flex items-center text-sm text-gray-600">
<div className="flex items-center text-sm text-muted-foreground">
<Phone className="mr-2 h-4 w-4" />
{appointment.doctor.phone || "N/A"}
</div>
@ -288,7 +263,7 @@ export default function SecretaryAppointments() {
<Pencil className="mr-2 h-4 w-4" />
Editar
</Button>
<Button variant="outline" size="sm" className="text-red-600 hover:text-red-700 hover:bg-red-50 bg-transparent" onClick={() => handleDelete(appointment)}>
<Button variant="outline" size="sm" className="text-destructive hover:text-destructive/90 hover:bg-destructive/10 bg-transparent" onClick={() => handleDelete(appointment)}>
<Trash2 className="mr-2 h-4 w-4" />
Cancelar
</Button>
@ -314,3 +289,28 @@ export default function SecretaryAppointments() {
</Sidebar>
);
}
const getStatusBadge = (status: string) => {
switch (status) {
case "requested":
return (
<Badge className="bg-yellow-400/10 text-yellow-400">Solicitada</Badge>
);
case "confirmed":
return <Badge className="bg-primary/10 text-primary">Confirmada</Badge>;
case "checked_in":
return (
<Badge className="bg-indigo-400/10 text-indigo-400">Check-in</Badge>
);
case "completed":
return <Badge className="bg-green-400/10 text-green-400">Realizada</Badge>;
case "cancelled":
return <Badge className="bg-destructive/10 text-destructive">Cancelada</Badge>;
case "no_show":
return (
<Badge className="bg-muted text-foreground">Não Compareceu</Badge>
);
default:
return <Badge variant="secondary">{status}</Badge>;
}
};

View File

@ -104,8 +104,8 @@ export default function SecretaryDashboard() {
<div className="space-y-6">
{/* Cabeçalho */}
<div>
<h1 className="text-3xl font-bold text-gray-900">Dashboard</h1>
<p className="text-gray-600">
<h1 className="text-3xl font-bold">Dashboard</h1>
<p className="text-muted-foreground">
Bem-vindo ao seu portal de consultas médicas
</p>
</div>
@ -122,7 +122,7 @@ export default function SecretaryDashboard() {
</CardHeader>
<CardContent>
{loadingAppointments ? (
<div className="text-gray-500 text-sm">
<div className="text-muted-foreground text-sm">
Carregando próxima consulta...
</div>
) : firstConfirmed ? (
@ -147,7 +147,7 @@ export default function SecretaryDashboard() {
</p>
</>
) : (
<div className="text-sm text-gray-500">
<div className="text-sm text-muted-foreground">
Nenhuma consulta confirmada encontrada
</div>
)}
@ -164,12 +164,12 @@ export default function SecretaryDashboard() {
</CardHeader>
<CardContent>
{loadingAppointments ? (
<div className="text-gray-500 text-sm">
<div className="text-muted-foreground text-sm">
Carregando consultas...
</div>
) : nextAgendada ? (
<>
<div className="text-lg font-bold text-gray-900">
<div className="text-lg font-bold">
{new Date(nextAgendada.scheduled_at).toLocaleDateString(
"pt-BR",
{
@ -199,7 +199,7 @@ export default function SecretaryDashboard() {
</p>
</>
) : (
<div className="text-sm text-gray-500">
<div className="text-sm text-muted-foreground">
Nenhuma consulta agendada neste mês
</div>
)}
@ -231,8 +231,8 @@ export default function SecretaryDashboard() {
</CardHeader>
<CardContent className="space-y-4">
<Link href="/secretary/schedule">
<Button className="w-full justify-start bg-blue-600 text-white hover:bg-blue-700">
<User className="mr-2 h-4 w-4 text-white" />
<Button className="w-full justify-start bg-primary text-primary-foreground hover:bg-primary/90">
<User className="mr-2 h-4 w-4" />
Agendar Nova Consulta
</Button>
</Link>
@ -265,9 +265,9 @@ export default function SecretaryDashboard() {
</CardHeader>
<CardContent>
{loadingPatients ? (
<p className="text-sm text-gray-500">Carregando pacientes...</p>
<p className="text-sm text-muted-foreground">Carregando pacientes...</p>
) : patients.length === 0 ? (
<p className="text-sm text-gray-500">
<p className="text-sm text-muted-foreground">
Nenhum paciente cadastrado.
</p>
) : (
@ -275,20 +275,20 @@ export default function SecretaryDashboard() {
{patients.map((patient, index) => (
<div
key={index}
className="flex items-center justify-between p-3 bg-blue-50 rounded-lg border border-blue-100"
className="flex items-center justify-between p-3 bg-primary/10 rounded-lg border border-primary/20"
>
<div>
<p className="font-medium text-gray-900">
<p className="font-medium text-foreground">
{patient.full_name || "Sem nome"}
</p>
<p className="text-sm text-gray-600">
<p className="text-sm text-muted-foreground">
{patient.phone_mobile ||
patient.phone1 ||
"Sem telefone"}
</p>
</div>
<div className="text-right">
<p className="font-medium text-blue-700">
<p className="font-medium text-primary">
{patient.convenio || "Particular"}
</p>
</div>

View File

@ -265,7 +265,7 @@ export default function EditarPacientePage() {
return (
<Sidebar>
{/* O espaçamento foi reduzido aqui: de `p-4 sm:p-6 lg:p-8` para `p-2 sm:p-4 lg:p-6` */}
<div className="space-y-6 p-2 sm:p-4 lg:p-6 max-w-10xl mx-auto"> {/* Alterado padding responsivo */}
<div className="space-y-6 p-2 sm:p-4 lg:p-6 max-w-10xl mx-auto">{/* Alterado padding responsivo */}
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
<div className="flex items-center gap-4">
<Link href="/secretary/pacientes">
@ -275,31 +275,29 @@ export default function EditarPacientePage() {
</Button>
</Link>
<div>
<h1 className="text-2xl font-bold text-gray-900">Editar Paciente</h1>
<p className="text-gray-600">Atualize as informações do paciente</p>
<h1 className="text-2xl font-bold">Editar Paciente</h1>
<p className="text-muted-foreground">Atualize as informações do paciente</p>
</div>
</div>
{/* Anexos Section - Movido para fora do cabeçalho para melhor organização e responsividade */}
{/* Espaço reservado para anexos ou ações futuras */}
</div>
<form onSubmit={handleSubmit} className="space-y-8">
{/* Dados Pessoais Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Dados Pessoais</h2>
<div className="bg-card rounded-lg border p-6">
<h2 className="text-lg font-semibold mb-6">Dados Pessoais</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{/* Photo upload */}
<div className="space-y-2 col-span-1 md:col-span-2 lg:col-span-1">
<Label>Foto do paciente</Label>
<div className="flex flex-col sm:flex-row items-center gap-4">
<div className="w-20 h-20 rounded-full bg-gray-100 overflow-hidden flex items-center justify-center">
<div className="w-20 h-20 rounded-full bg-muted overflow-hidden flex items-center justify-center">
{photoUrl ? (
// eslint-disable-next-line @next/next/no-img-element
<img src={photoUrl} alt="Foto do paciente" className="w-full h-full object-cover" />
) : (
<span className="text-gray-400 text-sm text-center">Sem foto</span>
<span className="text-muted-foreground text-sm text-center">Sem foto</span>
)}
</div>
<div className="flex flex-col sm:flex-row gap-2 mt-2 sm:mt-0">
@ -334,11 +332,11 @@ export default function EditarPacientePage() {
<Label>Sexo *</Label>
<div className="flex flex-col sm:flex-row gap-4">
<div className="flex items-center space-x-2">
<input type="radio" id="Masculino" name="sexo" value="Masculino" checked={formData.sexo === "Masculino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-blue-600" />
<input type="radio" id="Masculino" name="sexo" value="Masculino" checked={formData.sexo === "Masculino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-primary" />
<Label htmlFor="Masculino">Masculino</Label>
</div>
<div className="flex items-center space-x-2">
<input type="radio" id="Feminino" name="sexo" value="Feminino" checked={formData.sexo === "Feminino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-blue-600" />
<input type="radio" id="Feminino" name="sexo" value="Feminino" checked={formData.sexo === "Feminino"} onChange={(e) => handleInputChange("sexo", e.target.value)} className="w-4 h-4 text-primary" />
<Label htmlFor="Feminino">Feminino</Label>
</div>
</div>
@ -467,8 +465,8 @@ export default function EditarPacientePage() {
</div>
{/* Contact Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Contato</h2>
<div className="bg-card rounded-lg border p-6">
<h2 className="text-lg font-semibold mb-6">Contato</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="space-y-2">
@ -494,8 +492,8 @@ export default function EditarPacientePage() {
</div>
{/* Address Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Endereço</h2>
<div className="bg-card rounded-lg border p-6">
<h2 className="text-lg font-semibold mb-6">Endereço</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div className="space-y-2">
@ -569,8 +567,8 @@ export default function EditarPacientePage() {
</div>
{/* Medical Information Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Informações Médicas</h2>
<div className="bg-card rounded-lg border p-6">
<h2 className="text-lg font-semibold mb-6">Informações Médicas</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="space-y-2">
@ -615,8 +613,8 @@ export default function EditarPacientePage() {
</div>
{/* Insurance Information Section */}
<div className="bg-white rounded-lg border border-gray-200 p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-6">Informações de convênio</h2>
<div className="bg-card rounded-lg border p-6">
<h2 className="text-lg font-semibold mb-6">Informações de convênio</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="space-y-2">
@ -665,7 +663,7 @@ export default function EditarPacientePage() {
Cancelar
</Button>
</Link>
<Button type="submit" className="bg-blue-600 hover:bg-blue-700 w-full sm:w-auto">
<Button type="submit" className="bg-primary hover:bg-primary/90 w-full sm:w-auto">
<Save className="w-4 h-4 mr-2" />
Salvar Alterações
</Button>

View File

@ -15,95 +15,95 @@ import Sidebar from "@/components/Sidebar";
const PAGE_SIZE = 5;
export default function PacientesPage() {
// --- ESTADOS DE DADOS E GERAL ---
const [searchTerm, setSearchTerm] = useState("");
const [convenioFilter, setConvenioFilter] = useState("all");
const [vipFilter, setVipFilter] = useState("all");
// --- ESTADOS DE DADOS E GERAL ---
const [searchTerm, setSearchTerm] = useState("");
const [convenioFilter, setConvenioFilter] = useState("all");
const [vipFilter, setVipFilter] = useState("all");
// Lista completa, carregada da API uma única vez
const [allPatients, setAllPatients] = useState<any[]>([]);
// Lista após a aplicação dos filtros (base para a paginação)
const [filteredPatients, setFilteredPatients] = useState<any[]>([]);
// Lista completa, carregada da API uma única vez
const [allPatients, setAllPatients] = useState<any[]>([]);
// Lista após a aplicação dos filtros (base para a paginação)
const [filteredPatients, setFilteredPatients] = useState<any[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
// --- ESTADOS DE PAGINAÇÃO ---
const [page, setPage] = useState(1);
// --- ESTADOS DE PAGINAÇÃO ---
const [page, setPage] = useState(1);
// CÁLCULO DA PAGINAÇÃO
const totalPages = Math.ceil(filteredPatients.length / PAGE_SIZE);
const startIndex = (page - 1) * PAGE_SIZE;
const endIndex = startIndex + PAGE_SIZE;
// Pacientes a serem exibidos na tabela (aplicando a paginação)
const currentPatients = filteredPatients.slice(startIndex, endIndex);
// CÁLCULO DA PAGINAÇÃO
const totalPages = Math.ceil(filteredPatients.length / PAGE_SIZE);
const startIndex = (page - 1) * PAGE_SIZE;
const endIndex = startIndex + PAGE_SIZE;
// Pacientes a serem exibidos na tabela (aplicando a paginação)
const currentPatients = filteredPatients.slice(startIndex, endIndex);
// --- ESTADOS DE DIALOGS ---
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const [patientToDelete, setPatientToDelete] = useState<string | null>(null);
const [detailsDialogOpen, setDetailsDialogOpen] = useState(false);
const [patientDetails, setPatientDetails] = useState<any | null>(null);
// --- ESTADOS DE DIALOGS ---
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const [patientToDelete, setPatientToDelete] = useState<string | null>(null);
const [detailsDialogOpen, setDetailsDialogOpen] = useState(false);
const [patientDetails, setPatientDetails] = useState<any | null>(null);
// --- FUNÇÕES DE LÓGICA ---
// --- FUNÇÕES DE LÓGICA ---
// 1. Função para carregar TODOS os pacientes da API
const fetchAllPacientes = useCallback(
async () => {
setLoading(true);
setError(null);
try {
// Como o backend retorna um array, chamamos sem paginação
const res = await patientsService.list();
// 1. Função para carregar TODOS os pacientes da API
const fetchAllPacientes = useCallback(
async () => {
setLoading(true);
setError(null);
try {
// Como o backend retorna um array, chamamos sem paginação
const res = await patientsService.list();
const mapped = res.map((p: any) => ({
id: String(p.id ?? ""),
nome: p.full_name ?? "—",
telefone: p.phone_mobile ?? p.phone1 ?? "—",
cidade: p.city ?? "—",
estado: p.state ?? "—",
// Formate as datas se necessário, aqui usamos como string
ultimoAtendimento: p.last_visit_at?.split('T')[0] ?? "—",
proximoAtendimento: p.next_appointment_at?.split('T')[0] ?? "—",
vip: Boolean(p.vip ?? false),
convenio: p.convenio ?? "Particular", // Define um valor padrão
status: p.status ?? undefined,
}));
const mapped = res.map((p: any) => ({
id: String(p.id ?? ""),
nome: p.full_name ?? "—",
telefone: p.phone_mobile ?? p.phone1 ?? "—",
cidade: p.city ?? "—",
estado: p.state ?? "—",
// Formate as datas se necessário, aqui usamos como string
ultimoAtendimento: p.last_visit_at?.split('T')[0] ?? "—",
proximoAtendimento: p.next_appointment_at?.split('T')[0] ?? "—",
vip: Boolean(p.vip ?? false),
convenio: p.convenio ?? "Particular", // Define um valor padrão
status: p.status ?? undefined,
}));
setAllPatients(mapped);
} catch (e: any) {
console.error(e);
setError(e?.message || "Erro ao buscar pacientes");
} finally {
setLoading(false);
}
}, []);
setAllPatients(mapped);
} catch (e: any) {
console.error(e);
setError(e?.message || "Erro ao buscar pacientes");
} finally {
setLoading(false);
}
}, []);
// 2. Efeito para aplicar filtros e calcular a lista filtrada (chama-se quando allPatients ou filtros mudam)
useEffect(() => {
const filtered = allPatients.filter((patient) => {
// Filtro por termo de busca (Nome ou Telefone)
const matchesSearch =
patient.nome?.toLowerCase().includes(searchTerm.toLowerCase()) ||
patient.telefone?.includes(searchTerm);
// 2. Efeito para aplicar filtros e calcular a lista filtrada (chama-se quando allPatients ou filtros mudam)
useEffect(() => {
const filtered = allPatients.filter((patient) => {
// Filtro por termo de busca (Nome ou Telefone)
const matchesSearch =
patient.nome?.toLowerCase().includes(searchTerm.toLowerCase()) ||
patient.telefone?.includes(searchTerm);
// Filtro por Convênio
const matchesConvenio =
convenioFilter === "all" ||
patient.convenio === convenioFilter;
// Filtro por Convênio
const matchesConvenio =
convenioFilter === "all" ||
patient.convenio === convenioFilter;
// Filtro por VIP
const matchesVip =
vipFilter === "all" ||
(vipFilter === "vip" && patient.vip) ||
(vipFilter === "regular" && !patient.vip);
// Filtro por VIP
const matchesVip =
vipFilter === "all" ||
(vipFilter === "vip" && patient.vip) ||
(vipFilter === "regular" && !patient.vip);
return matchesSearch && matchesConvenio && matchesVip;
});
return matchesSearch && matchesConvenio && matchesVip;
});
setFilteredPatients(filtered);
// Garante que a página atual seja válida após a filtragem
setPage(1);
}, [allPatients, searchTerm, convenioFilter, vipFilter]);
setFilteredPatients(filtered);
// Garante que a página atual seja válida após a filtragem
setPage(1);
}, [allPatients, searchTerm, convenioFilter, vipFilter]);
// 3. Efeito inicial para buscar os pacientes
useEffect(() => {
@ -111,18 +111,18 @@ export default function PacientesPage() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// --- LÓGICA DE AÇÕES (DELETAR / VER DETALHES) ---
// --- LÓGICA DE AÇÕES (DELETAR / VER DETALHES) ---
const openDetailsDialog = async (patientId: string) => {
setDetailsDialogOpen(true);
setPatientDetails(null);
try {
const res = await patientsService.getById(patientId);
setPatientDetails(Array.isArray(res) ? res[0] : res); // Supondo que retorne um array com um item
} catch (e: any) {
setPatientDetails({ error: e?.message || "Erro ao buscar detalhes" });
}
};
const openDetailsDialog = async (patientId: string) => {
setDetailsDialogOpen(true);
setPatientDetails(null);
try {
const res = await patientsService.getById(patientId);
setPatientDetails(Array.isArray(res) ? res[0] : res); // Supondo que retorne um array com um item
} catch (e: any) {
setPatientDetails({ error: e?.message || "Erro ao buscar detalhes" });
}
};
const handleDeletePatient = async (patientId: string) => {
try {
@ -149,7 +149,7 @@ export default function PacientesPage() {
{/* Header (Responsividade OK) */}
<div className="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
<div>
<h1 className="text-xl md:text-2xl font-bold text-foreground">
<h1 className="text-xl md:text-2xl font-bold">
Pacientes
</h1>
<p className="text-muted-foreground text-sm md:text-base">
@ -158,7 +158,7 @@ export default function PacientesPage() {
</div>
<div className="flex gap-2">
<Link href="/secretary/pacientes/novo" className="w-full md:w-auto">
<Button className="w-full bg-blue-600 hover:bg-blue-700">
<Button className="w-full bg-primary hover:bg-primary/90">
<Plus className="w-4 h-4 mr-2" />
Adicionar
</Button>
@ -166,22 +166,22 @@ export default function PacientesPage() {
</div>
</div>
{/* Bloco de Filtros (Responsividade APLICADA) */}
<div className="flex flex-wrap items-center gap-4 bg-card p-4 rounded-lg border border-border">
<Filter className="w-5 h-5 text-gray-400" />
{/* Bloco de Filtros (Responsividade APLICADA) */}
<div className="flex flex-wrap items-center gap-4 bg-card p-4 rounded-lg border">
<Filter className="w-5 h-5 text-muted-foreground" />
{/* Busca - Ocupa 100% no mobile, depois cresce */}
<input
type="text"
placeholder="Buscar por nome ou telefone..."
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
className="w-full sm:flex-grow sm:min-w-[150px] p-2 border rounded-md text-sm"
/>
{/* Busca - Ocupa 100% no mobile, depois cresce */}
<input
type="text"
placeholder="Buscar por nome ou telefone..."
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
className="w-full sm:flex-grow sm:min-w-[150px] p-2 border rounded-md text-sm"
/>
{/* Convênio - Ocupa a largura total em telas pequenas, depois se ajusta */}
<div className="flex items-center gap-2 w-full sm:w-auto sm:flex-grow sm:max-w-[200px]">
<span className="text-sm font-medium text-foreground whitespace-nowrap hidden md:block">
<span className="text-sm font-medium whitespace-nowrap hidden md:block">
Convênio
</span>
<Select value={convenioFilter} onValueChange={setConvenioFilter}>
@ -200,64 +200,64 @@ export default function PacientesPage() {
</Select>
</div>
{/* VIP - Ocupa a largura total em telas pequenas, depois se ajusta */}
<div className="flex items-center gap-2 w-full sm:w-auto sm:flex-grow sm:max-w-[150px]">
<span className="text-sm font-medium text-foreground whitespace-nowrap hidden md:block">VIP</span>
<Select value={vipFilter} onValueChange={setVipFilter}>
<SelectTrigger className="w-full sm:w-32"> {/* w-full para mobile, w-32 para sm+ */}
<SelectValue placeholder="VIP" />
</SelectTrigger>
<SelectContent>
<SelectItem value="all">Todos</SelectItem>
<SelectItem value="vip">VIP</SelectItem>
<SelectItem value="regular">Regular</SelectItem>
</SelectContent>
</Select>
</div>
</div>
{/* VIP - Ocupa a largura total em telas pequenas, depois se ajusta */}
<div className="flex items-center gap-2 w-full sm:w-auto sm:flex-grow sm:max-w-[150px]">
<span className="text-sm font-medium whitespace-nowrap hidden md:block">VIP</span>
<Select value={vipFilter} onValueChange={setVipFilter}>
<SelectTrigger className="w-full sm:w-32"> {/* w-full para mobile, w-32 para sm+ */}
<SelectValue placeholder="VIP" />
</SelectTrigger>
<SelectContent>
<SelectItem value="all">Todos</SelectItem>
<SelectItem value="vip">VIP</SelectItem>
<SelectItem value="regular">Regular</SelectItem>
</SelectContent>
</Select>
</div>
</div>
{/* --- SEÇÃO DE TABELA (VISÍVEL EM TELAS MAIORES OU IGUAIS A MD) --- */}
{/* Garantir que a tabela se esconda em telas menores e apareça em MD+ */}
<div className="bg-white rounded-lg border border-gray-200 shadow-md hidden md:block">
<div className="bg-card rounded-lg border shadow-md hidden md:block">
<div className="overflow-x-auto">
{" "}
{/* Permite rolagem horizontal se a tabela for muito larga */}
{error ? (
<div className="p-6 text-red-600">{`Erro ao carregar pacientes: ${error}`}</div>
<div className="p-6 text-destructive">{`Erro ao carregar pacientes: ${error}`}</div>
) : loading ? (
<div className="p-6 text-center text-gray-500 flex items-center justify-center">
<Loader2 className="w-6 h-6 mr-2 animate-spin text-green-600" />{" "}
<div className="p-6 text-center text-muted-foreground flex items-center justify-center">
<Loader2 className="w-6 h-6 mr-2 animate-spin text-primary" />{" "}
Carregando pacientes...
</div>
) : (
<table className="w-full min-w-[650px]">
{" "}
{/* min-w para evitar que a tabela se contraia demais */}
<thead className="bg-gray-50 border-b border-gray-200">
<thead className="bg-muted border-b">
<tr>
<th className="text-left p-4 font-medium text-gray-700 w-[20%]">
<th className="text-left p-4 font-medium text-muted-foreground w-[20%]">
Nome
</th>
{/* Ajustes de visibilidade de colunas para diferentes breakpoints */}
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden sm:table-cell">
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden sm:table-cell">
Telefone
</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden md:table-cell">
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden md:table-cell">
Cidade / Estado
</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden sm:table-cell">
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden sm:table-cell">
Convênio
</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden lg:table-cell">
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden lg:table-cell">
Último atendimento
</th>
<th className="text-left p-4 font-medium text-gray-700 w-[15%] hidden lg:table-cell">
<th className="text-left p-4 font-medium text-muted-foreground w-[15%] hidden lg:table-cell">
Próximo atendimento
</th>
<th className="text-left p-4 font-medium text-gray-700 w-[5%]">
<th className="text-left p-4 font-medium text-muted-foreground w-[5%]">
Ações
</th>
</tr>
@ -265,7 +265,7 @@ export default function PacientesPage() {
<tbody>
{currentPatients.length === 0 ? (
<tr>
<td colSpan={7} className="p-8 text-center text-gray-500">
<td colSpan={7} className="p-8 text-center text-muted-foreground">
{allPatients.length === 0
? "Nenhum paciente cadastrado"
: "Nenhum paciente encontrado com os filtros aplicados"}
@ -275,46 +275,47 @@ export default function PacientesPage() {
currentPatients.map((patient) => (
<tr
key={patient.id}
className="border-b border-gray-100 hover:bg-gray-50"
className="border-b hover:bg-muted"
>
<td className="p-4">
<div className="flex items-center gap-3">
<div className="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center">
<span className="text-blue-600 font-medium text-sm">
<div className="w-8 h-8 bg-primary/10 rounded-full flex items-center justify-center">
<span className="text-primary font-medium text-sm">
{patient.nome?.charAt(0) || "?"}
</span>
</div>
<span className="font-medium text-gray-900">
<span className="font-medium">
{patient.nome}
{patient.vip && (
<span className="ml-2 px-2 py-0.5 text-xs font-semibold text-purple-600 bg-purple-100 rounded-full">
<span className="ml-2 px-2 py-0.5 text-xs font-semibold text-purple-500 bg-purple-500/10 rounded-full">
VIP
</span>
)}
</span>
</div>
</td>
<td className="p-4 text-gray-600 hidden sm:table-cell">
<td className="p-4 text-muted-foreground hidden sm:table-cell">
{patient.telefone}
</td>
<td className="p-4 text-gray-600 hidden md:table-cell">{`${patient.cidade} / ${patient.estado}`}</td>
<td className="p-4 text-gray-600 hidden sm:table-cell">
<td className="p-4 text-muted-foreground hidden md:table-cell">{`${patient.cidade} / ${patient.estado}`}</td>
<td className="p-4 text-muted-foreground hidden sm:table-cell">
{patient.convenio}
</td>
<td className="p-4 text-gray-600 hidden lg:table-cell">
<td className="p-4 text-muted-foreground hidden lg:table-cell">
{patient.ultimoAtendimento}
</td>
<td className="p-4 text-gray-600 hidden lg:table-cell">
<td className="p-4 text-muted-foreground hidden lg:table-cell">
{patient.proximoAtendimento}
</td>
<td className="p-4">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<div className="text-blue-600 cursor-pointer">
Ações
</div>
<Button variant="ghost" className="h-8 w-8 p-0">
<span className="sr-only">Abrir menu</span>
<MoreVertical className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
@ -341,7 +342,7 @@ export default function PacientesPage() {
Marcar consulta
</DropdownMenuItem>
<DropdownMenuItem
className="text-red-600"
className="text-destructive"
onClick={() =>
openDeleteDialog(String(patient.id))
}
@ -363,16 +364,16 @@ export default function PacientesPage() {
{/* --- SEÇÃO DE CARDS (VISÍVEL APENAS EM TELAS MENORES QUE MD) --- */}
{/* Garantir que os cards apareçam em telas menores e se escondam em MD+ */}
<div className="bg-white rounded-lg border border-gray-200 shadow-md p-4 block md:hidden">
<div className="bg-card rounded-lg border shadow-md p-4 block md:hidden">
{error ? (
<div className="p-6 text-red-600">{`Erro ao carregar pacientes: ${error}`}</div>
<div className="p-6 text-destructive">{`Erro ao carregar pacientes: ${error}`}</div>
) : loading ? (
<div className="p-6 text-center text-gray-500 flex items-center justify-center">
<Loader2 className="w-6 h-6 mr-2 animate-spin text-green-600" />{" "}
<div className="p-6 text-center text-muted-foreground flex items-center justify-center">
<Loader2 className="w-6 h-6 mr-2 animate-spin text-primary" />{" "}
Carregando pacientes...
</div>
) : filteredPatients.length === 0 ? (
<div className="p-8 text-center text-gray-500">
<div className="p-8 text-center text-muted-foreground">
{allPatients.length === 0
? "Nenhum paciente cadastrado"
: "Nenhum paciente encontrado com os filtros aplicados"}
@ -382,21 +383,21 @@ export default function PacientesPage() {
{currentPatients.map((patient) => (
<div
key={patient.id}
className="bg-gray-50 rounded-lg p-4 flex flex-col sm:flex-row justify-between items-start sm:items-center border border-gray-200"
className="bg-muted rounded-lg p-4 flex flex-col sm:flex-row justify-between items-start sm:items-center border"
>
<div className="flex-grow mb-2 sm:mb-0">
<div className="font-semibold text-lg text-gray-900 flex items-center">
<div className="font-semibold text-lg flex items-center">
{patient.nome}
{patient.vip && (
<span className="ml-2 px-2 py-0.5 text-xs font-semibold text-purple-600 bg-purple-100 rounded-full">
<span className="ml-2 px-2 py-0.5 text-xs font-semibold text-purple-500 bg-purple-500/10 rounded-full">
VIP
</span>
)}
</div>
<div className="text-sm text-gray-600">
<div className="text-sm text-muted-foreground">
Telefone: {patient.telefone}
</div>
<div className="text-sm text-gray-600">
<div className="text-sm text-muted-foreground">
Convênio: {patient.convenio}
</div>
</div>
@ -416,83 +417,83 @@ export default function PacientesPage() {
Ver detalhes
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href={`/secretary/pacientes/${patient.id}/editar`} className="flex items-center w-full">
<Edit className="w-4 h-4 mr-2" />
Editar
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href={`/secretary/pacientes/${patient.id}/editar`} className="flex items-center w-full">
<Edit className="w-4 h-4 mr-2" />
Editar
</Link>
</DropdownMenuItem>
<DropdownMenuItem>
<Calendar className="w-4 h-4 mr-2" />
Marcar consulta
</DropdownMenuItem>
<DropdownMenuItem className="text-red-600" onClick={() => openDeleteDialog(String(patient.id))}>
<Trash2 className="w-4 h-4 mr-2" />
Excluir
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
))}
</div>
)}
<DropdownMenuItem>
<Calendar className="w-4 h-4 mr-2" />
Marcar consulta
</DropdownMenuItem>
<DropdownMenuItem className="text-destructive" onClick={() => openDeleteDialog(String(patient.id))}>
<Trash2 className="w-4 h-4 mr-2" />
Excluir
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
))}
</div>
)}
</div>
{/* Paginação */}
{totalPages > 1 && !loading && (
<div className="flex flex-col sm:flex-row items-center justify-center p-4 border-t border-gray-200">
<div className="flex space-x-2 flex-wrap justify-center"> {/* Adicionado flex-wrap e justify-center para botões da paginação */}
<Button
onClick={() => setPage((prev) => Math.max(1, prev - 1))}
disabled={page === 1}
variant="outline"
size="lg"
>
&lt; Anterior
</Button>
{/* Paginação */}
{totalPages > 1 && !loading && (
<div className="flex flex-col sm:flex-row items-center justify-center p-4 border-t">
<div className="flex space-x-2 flex-wrap justify-center"> {/* Adicionado flex-wrap e justify-center para botões da paginação */}
<Button
onClick={() => setPage((prev) => Math.max(1, prev - 1))}
disabled={page === 1}
variant="outline"
size="lg"
>
&lt; Anterior
</Button>
{Array.from({ length: totalPages }, (_, index) => index + 1)
.slice(Math.max(0, page - 3), Math.min(totalPages, page + 2))
.map((pageNumber) => (
<Button
key={pageNumber}
onClick={() => setPage(pageNumber)}
variant={pageNumber === page ? "default" : "outline"}
size="lg"
className={pageNumber === page ? "bg-blue-600 hover:bg-blue-700 text-white" : "text-gray-700"}
>
{pageNumber}
</Button>
))}
{Array.from({ length: totalPages }, (_, index) => index + 1)
.slice(Math.max(0, page - 3), Math.min(totalPages, page + 2))
.map((pageNumber) => (
<Button
key={pageNumber}
onClick={() => setPage(pageNumber)}
variant={pageNumber === page ? "default" : "outline"}
size="lg"
className={pageNumber === page ? "bg-primary hover:bg-primary/90 text-primary-foreground" : "text-muted-foreground"}
>
{pageNumber}
</Button>
))}
<Button
onClick={() => setPage((prev) => Math.min(totalPages, prev + 1))}
disabled={page === totalPages}
variant="outline"
size="lg"
>
Próximo &gt;
</Button>
</div>
</div>
)}
<Button
onClick={() => setPage((prev) => Math.min(totalPages, prev + 1))}
disabled={page === totalPages}
variant="outline"
size="lg"
>
Próximo &gt;
</Button>
</div>
</div>
)}
{/* AlertDialogs (Permanecem os mesmos) */}
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Confirmar exclusão</AlertDialogTitle>
<AlertDialogDescription>Tem certeza que deseja excluir este paciente? Esta ação não pode ser desfeita.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancelar</AlertDialogCancel>
<AlertDialogAction onClick={() => patientToDelete && handleDeletePatient(patientToDelete)} className="bg-red-600 hover:bg-red-700">
Excluir
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
{/* AlertDialogs (Permanecem os mesmos) */}
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Confirmar exclusão</AlertDialogTitle>
<AlertDialogDescription>Tem certeza que deseja excluir este paciente? Esta ação não pode ser desfeita.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancelar</AlertDialogCancel>
<AlertDialogAction onClick={() => patientToDelete && handleDeletePatient(patientToDelete)} className="bg-destructive hover:bg-destructive/90">
Excluir
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
<AlertDialog
open={detailsDialogOpen}
@ -503,12 +504,12 @@ export default function PacientesPage() {
<AlertDialogTitle>Detalhes do Paciente</AlertDialogTitle>
<AlertDialogDescription>
{patientDetails === null ? (
<div className="text-gray-500">
<Loader2 className="w-6 h-6 animate-spin mx-auto text-green-600 my-4" />
<div className="text-muted-foreground">
<Loader2 className="w-6 h-6 animate-spin mx-auto text-primary my-4" />
Carregando...
</div>
) : patientDetails?.error ? (
<div className="text-red-600 p-4">{patientDetails.error}</div>
<div className="text-destructive p-4">{patientDetails.error}</div>
) : (
<div className="grid gap-4 py-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">

View File

@ -1,4 +1,3 @@
// Caminho: [seu-caminho]/ManagerLayout.tsx
"use client";
import type React from "react";
@ -7,6 +6,7 @@ import { useRouter, usePathname } from "next/navigation";
import Link from "next/link";
import Cookies from "js-cookie";
import { api } from "@/services/api.mjs";
import { useAccessibility } from "@/app/context/AccessibilityContext";
import { Button } from "@/components/ui/button";
import {
@ -30,7 +30,6 @@ import {
SquareUser,
ClipboardList,
Stethoscope,
ClipboardMinus,
} from "lucide-react";
import SidebarUserSection from "@/components/ui/userToolTip";
@ -74,6 +73,7 @@ export default function Sidebar({ children }: SidebarProps) {
const [showLogoutDialog, setShowLogoutDialog] = useState(false);
const router = useRouter();
const pathname = usePathname();
const { theme, contrast } = useAccessibility();
useEffect(() => {
const userInfoString = localStorage.getItem("user_info");
@ -212,6 +212,7 @@ export default function Sidebar({ children }: SidebarProps) {
};
const menuItems = SetMenuItems(role);
const isDefaultMode = theme === "light" && contrast === "normal";
if (!userData) {
return (
@ -222,17 +223,17 @@ export default function Sidebar({ children }: SidebarProps) {
}
return (
<div className="min-h-screen bg-gray-50 flex">
<div className="min-h-screen bg-background flex">
<div
className={`fixed top-0 h-screen flex flex-col z-30 transition-all duration-300
${sidebarCollapsed ? "w-16" : "w-64"}
bg-[#123965] text-white`}
${isDefaultMode ? "bg-[#123965] text-white" : "bg-sidebar text-sidebar-foreground"}`}
>
{/* TOPO */}
<div className="p-4 border-b border-white/10 flex items-center justify-between">
<div className={`p-4 border-b ${isDefaultMode ? "border-white/10" : "border-sidebar-border"} flex items-center justify-between`}>
{!sidebarCollapsed && (
<div className="flex items-center gap-2">
<div className="bg-white p-1 rounded-lg">
<div className="bg-background p-1 rounded-lg">
<img
src="/Logo MedConnect.png"
alt="Logo MedConnect"
@ -240,7 +241,7 @@ export default function Sidebar({ children }: SidebarProps) {
/>
</div>
<span className="font-semibold text-white text-lg">
<span className="font-semibold text-lg">
MedConnect
</span>
</div>
@ -250,7 +251,7 @@ export default function Sidebar({ children }: SidebarProps) {
variant="ghost"
size="sm"
onClick={() => setSidebarCollapsed(!sidebarCollapsed)}
className="p-1 text-white hover:bg-white/10 cursor-pointer"
className={`p-1 ${isDefaultMode ? "text-white hover:bg-white/10" : "hover:bg-sidebar-accent"} cursor-pointer`}
>
{sidebarCollapsed ? (
<ChevronRight className="w-5 h-5" />
@ -273,8 +274,8 @@ export default function Sidebar({ children }: SidebarProps) {
flex items-center gap-3 px-3 py-2 rounded-lg mb-1 transition-colors
${
isActive
? "bg-white/20 text-white font-semibold"
: "text-white/80 hover:bg-white/10 hover:text-white"
? `${isDefaultMode ? "bg-white/20 text-white font-semibold" : "bg-sidebar-primary text-sidebar-primary-foreground font-semibold"}`
: `${isDefaultMode ? "text-white/80 hover:bg-white/10 hover:text-white" : "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}`
}
`}
>
@ -289,7 +290,7 @@ export default function Sidebar({ children }: SidebarProps) {
</nav>
{/* PERFIL ORIGINAL + NOME BRANCO */}
<div className="mt-auto p-3 border-t border-white/10">
<div className={`mt-auto p-3 border-t ${isDefaultMode ? "border-white/10" : "border-sidebar-border"}`}>
<SidebarUserSection
userData={userData}
sidebarCollapsed={sidebarCollapsed}
@ -304,28 +305,27 @@ export default function Sidebar({ children }: SidebarProps) {
}`}
>
<main className="flex-1 p-4 md:p-6">{children}</main>
<Dialog open={showLogoutDialog} onOpenChange={setShowLogoutDialog}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
<DialogTitle>Confirmar Saída</DialogTitle>
<DialogDescription>
Deseja realmente sair do sistema? Você precisará fazer login
novamente.
</DialogDescription>
</DialogHeader>
<DialogFooter className="flex gap-2">
<Button variant="outline" onClick={cancelLogout}>
Cancelar
</Button>
<Button variant="destructive" onClick={confirmLogout}>
<LogOut className="mr-2 h-4 w-4" />
Sair
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
<Dialog open={showLogoutDialog} onOpenChange={setShowLogoutDialog}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
<DialogTitle>Confirmar Saída</DialogTitle>
<DialogDescription>
Deseja realmente sair do sistema? Você precisará fazer login
novamente.
</DialogDescription>
</DialogHeader>
<DialogFooter className="flex gap-2">
<Button variant="outline" onClick={cancelLogout}>
Cancelar
</Button>
<Button variant="destructive" onClick={confirmLogout}>
<LogOut className="mr-2 h-4 w-4" />
Sair
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
 
</div>
);
}

View File

@ -354,8 +354,8 @@ export default function ScheduleForm() {
<div className="py-3 px-2">
<div className="max-w-7xl mx-auto space-y-3">
<div className="space-y-1">
<h1 className="text-3xl font-bold text-slate-900">Agendar Consulta</h1>
<p className="text-slate-600">Selecione o médico, data e horário para sua consulta</p>
<h1 className="text-3xl font-bold text-foreground">Agendar Consulta</h1>
<p className="text-muted-foreground">Selecione o médico, data e horário para sua consulta</p>
</div>
<div className="grid lg:grid-cols-[1fr,380px] gap-4">
@ -458,30 +458,30 @@ export default function ScheduleForm() {
</form>
<div className="space-y-3">
<Card className="border-2 border-blue-200 shadow-lg bg-gradient-to-br from-blue-50 to-white sticky top-6">
<CardHeader className="pb-3 border-b border-blue-100">
<CardTitle className="text-blue-900 flex items-center gap-2">
<Card className="border-2 border-primary shadow-lg sticky top-6">
<CardHeader className="pb-3 border-b border-primary/20">
<CardTitle className="text-primary flex items-center gap-2">
<User className="h-5 w-5" />
Resumo da Consulta
</CardTitle>
</CardHeader>
<CardContent className="pt-3 space-y-3">
<div className="space-y-1">
<p className="text-xs font-medium text-slate-600">Médico</p>
<p className="text-sm font-semibold text-slate-900">
<p className="text-xs font-medium text-muted-foreground">Médico</p>
<p className="text-sm font-semibold text-foreground">
{selectedDoctor ? doctors.find((d) => d.id === selectedDoctor)?.full_name : "Não selecionado"}
</p>
</div>
<div className="space-y-1">
<p className="text-xs font-medium text-slate-600">Data</p>
<p className="text-sm font-semibold text-slate-900">
<p className="text-xs font-medium text-muted-foreground">Data</p>
<p className="text-sm font-semibold text-foreground">
{selectedDate ? format(new Date(selectedDate + "T12:00:00"), "dd/MM/yyyy") : "Não selecionada"}
</p>
</div>
<div className="space-y-2">
<Label htmlFor="time-select" className="text-xs font-medium text-slate-600">
<Label htmlFor="time-select" className="text-xs font-medium text-muted-foreground">
Horário
</Label>
<Select
@ -512,20 +512,20 @@ export default function ScheduleForm() {
<div className="pt-3 border-t border-blue-100 space-y-2">
<div className="flex justify-between text-xs">
<span className="text-slate-600">Tipo:</span>
<span className="font-medium text-slate-900 capitalize">{tipoConsulta}</span>
<span className="text-muted-foreground">Tipo:</span>
<span className="font-medium text-foreground capitalize">{tipoConsulta}</span>
</div>
<div className="flex justify-between text-xs">
<span className="text-slate-600">Duração:</span>
<span className="font-medium text-slate-900">{duracao} minutos</span>
<span className="text-muted-foreground">Duração:</span>
<span className="font-medium text-foreground">{duracao} minutos</span>
</div>
</div>
{notes && (
<div className="pt-3 border-t border-blue-100">
<div className="pt-3 border-t border-primary/20">
<div className="flex items-start gap-2">
<StickyNote className="h-4 w-4 text-blue-600 mt-0.5 flex-shrink-0" />
<p className="text-xs italic text-slate-700 line-clamp-3">{notes}</p>
<p className="text-xs italic text-muted-foreground line-clamp-3">{notes}</p>
</div>
</div>
)}

View File

@ -76,23 +76,23 @@ export default function WeeklyScheduleCard({ doctorId }: WeeklyScheduleProps) {
return (
<div className="space-y-4 grid md:grid-cols-7 gap-2">
{loading ? (
<p className="text-sm text-gray-500 col-span-7 text-center">Carregando...</p>
<p className="text-sm text-muted-foreground col-span-7 text-center">Carregando...</p>
) : (
["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "Saturday"].map((day) => {
["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"].map((day) => {
const times = schedule[day] || [];
return (
<div key={day} className="space-y-4">
<div className="flex flex-col items-center justify-between p-3 bg-blue-50 rounded-lg">
<p className="font-medium capitalize">{weekdaysPT[day]}</p>
<div className="flex flex-col items-center justify-between p-3 bg-primary/10 rounded-lg">
<p className="font-medium capitalize text-foreground">{weekdaysPT[day]}</p>
<div className="text-center">
{times.length > 0 ? (
times.map((t, i) => (
<p key={i} className="text-sm text-gray-600">
<p key={i} className="text-sm text-muted-foreground">
{formatTime(t.start)} <br /> {formatTime(t.end)}
</p>
))
) : (
<p className="text-sm text-gray-400 italic">Sem horário</p>
<p className="text-sm text-muted-foreground italic">Sem horário</p>
)}
</div>
</div>

View File

@ -53,16 +53,16 @@ export function FilterBar({
Object.values(activeFilters).some(val => val !== "all" && val !== "");
return (
<div className={`flex flex-col md:flex-row items-start md:items-center gap-3 bg-white p-4 rounded-lg border border-gray-200 ${className}`}>
<div className={`flex flex-col md:flex-row items-start md:items-center gap-3 bg-card p-4 rounded-lg border ${className}`}>
{/* Barra de Pesquisa */}
<div className="relative w-full md:flex-1">
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400" />
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input
placeholder={searchPlaceholder}
value={searchTerm}
onChange={(e) => onSearch(e.target.value)}
className="pl-10 w-full bg-gray-50 border-gray-200 focus:bg-white transition-colors"
className="pl-10 w-full bg-muted border-border focus:bg-card transition-colors"
/>
</div>
@ -100,7 +100,7 @@ export function FilterBar({
variant="ghost"
size="icon"
onClick={onClearFilters}
className="text-gray-500 hover:text-red-600"
className="text-muted-foreground hover:text-destructive"
title="Limpar filtros"
>
<X className="h-4 w-4" />

View File

@ -45,10 +45,10 @@ export function PatientDetailsModal({
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent className="max-w-[95%] sm:max-w-lg max-h-[90vh] overflow-y-auto">
<DialogContent className="max-w-[95%] sm:max-w-lg max-h-[90vh] overflow-y-auto bg-card text-card-foreground border border-border">
<DialogHeader>
<DialogTitle className="text-xl font-bold">Detalhes do Paciente</DialogTitle>
<DialogDescription>
<DialogTitle className="text-xl font-bold text-foreground">Detalhes do Paciente</DialogTitle>
<DialogDescription className="text-muted-foreground">
Informações detalhadas sobre o paciente.
</DialogDescription>
</DialogHeader>
@ -57,80 +57,80 @@ export function PatientDetailsModal({
{/* Grid Principal */}
<div className="grid grid-cols-2 gap-4 text-sm">
<div>
<p className="font-semibold text-gray-900">Nome Completo</p>
<p className="text-gray-700">{patient.nome}</p>
<p className="font-semibold text-foreground">Nome Completo</p>
<p className="text-muted-foreground">{patient.nome}</p>
</div>
{/* CORREÇÃO AQUI: Adicionado 'break-all' para quebrar o email */}
<div>
<p className="font-semibold text-gray-900">Email</p>
<p className="text-gray-700 break-all">{patient.email || "N/A"}</p>
<p className="font-semibold text-foreground">Email</p>
<p className="text-muted-foreground break-all">{patient.email || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Telefone</p>
<p className="text-gray-700">{patient.telefone}</p>
<p className="font-semibold text-foreground">Telefone</p>
<p className="text-muted-foreground">{patient.telefone}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Data de Nascimento</p>
<p className="text-gray-700">{patient.birth_date || "N/A"}</p>
<p className="font-semibold text-foreground">Data de Nascimento</p>
<p className="text-muted-foreground">{patient.birth_date || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">CPF</p>
<p className="text-gray-700">{patient.cpf || "N/A"}</p>
<p className="font-semibold text-foreground">CPF</p>
<p className="text-muted-foreground">{patient.cpf || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Tipo Sanguíneo</p>
<p className="text-gray-700">{patient.blood_type || "N/A"}</p>
<p className="font-semibold text-foreground">Tipo Sanguíneo</p>
<p className="text-muted-foreground">{patient.blood_type || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Peso (kg)</p>
<p className="text-gray-700">{patient.weight_kg || "0"}</p>
<p className="font-semibold text-foreground">Peso (kg)</p>
<p className="text-muted-foreground">{patient.weight_kg || "0"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Altura (m)</p>
<p className="text-gray-700">{patient.height_m || "0"}</p>
<p className="font-semibold text-foreground">Altura (m)</p>
<p className="text-muted-foreground">{patient.height_m || "0"}</p>
</div>
</div>
<hr className="border-gray-200" />
<hr className="border-border" />
{/* Seção de Endereço */}
<div>
<h4 className="font-semibold mb-3 text-gray-900">Endereço</h4>
<h4 className="font-semibold mb-3 text-foreground">Endereço</h4>
<div className="grid grid-cols-2 gap-4 text-sm">
<div>
<p className="font-semibold text-gray-900">Rua</p>
<p className="text-gray-700">
<p className="font-semibold text-foreground">Rua</p>
<p className="text-muted-foreground">
{patient.street && patient.street !== "N/A"
? `${patient.street}, ${patient.number || ""}`
: "N/A"}
</p>
</div>
<div>
<p className="font-semibold text-gray-900">Complemento</p>
<p className="text-gray-700">{patient.complement || "N/A"}</p>
<p className="font-semibold text-foreground">Complemento</p>
<p className="text-muted-foreground">{patient.complement || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Bairro</p>
<p className="text-gray-700">{patient.neighborhood || "N/A"}</p>
<p className="font-semibold text-foreground">Bairro</p>
<p className="text-muted-foreground">{patient.neighborhood || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Cidade</p>
<p className="text-gray-700">{patient.cidade || "N/A"}</p>
<p className="font-semibold text-foreground">Cidade</p>
<p className="text-muted-foreground">{patient.cidade || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">Estado</p>
<p className="text-gray-700">{patient.estado || "N/A"}</p>
<p className="font-semibold text-foreground">Estado</p>
<p className="text-muted-foreground">{patient.estado || "N/A"}</p>
</div>
<div>
<p className="font-semibold text-gray-900">CEP</p>
<p className="text-gray-700">{patient.cep || "N/A"}</p>
<p className="font-semibold text-foreground">CEP</p>
<p className="text-muted-foreground">{patient.cep || "N/A"}</p>
</div>
</div>
</div>

View File

@ -93,7 +93,7 @@ export default function SidebarUserSection({
<PopoverContent
align="center"
side="top"
className="w-64 p-4 shadow-lg border bg-white"
className="w-64 p-4 shadow-2xl border-2 border-primary/20 bg-card text-card-foreground ring-1 ring-primary/10"
>
<nav>
{menuItems.map((item) => {
@ -104,8 +104,8 @@ export default function SidebarUserSection({
<div
className={`flex items-center gap-3 px-3 py-2 rounded-lg mb-1 transition-colors ${
isActive
? "bg-blue-50 text-blue-600 border-r-2 border-blue-600"
: "text-gray-600 hover:bg-gray-50"
? "bg-primary/10 text-primary border-r-2 border-primary"
: "text-foreground hover:bg-muted"
}`}
>
<Icon className="w-5 h-5 flex-shrink-0" />
@ -125,19 +125,19 @@ export default function SidebarUserSection({
size="sm"
className={
sidebarCollapsed
? "w-full bg-white text-black flex justify-center items-center p-2 hover:bg-gray-200"
: "w-full bg-white text-black hover:bg-gray-200 cursor-pointer"
? "w-full bg-card text-foreground border-2 border-border flex justify-center items-center p-2 hover:bg-muted"
: "w-full bg-card text-foreground border-2 border-border hover:bg-muted cursor-pointer"
}
onClick={handleLogout}
>
<LogOut
className={
sidebarCollapsed ? "h-5 w-5 text-black" : "mr-2 h-4 w-4 text-black"
sidebarCollapsed ? "h-5 w-5" : "mr-2 h-4 w-4"
}
/>
{!sidebarCollapsed && "Sair"}
</Button>
   
</div>
);
}
}