Agregar hora a laboratorios: modal importar, save con hora seleccionada
This commit is contained in:
+33
-33
@@ -18,17 +18,17 @@ interface PacientesProps {
|
||||
onEliminar: (id: string) => void;
|
||||
}
|
||||
|
||||
export function Pacientes({
|
||||
pacientes,
|
||||
export function Pacientes({
|
||||
pacientes,
|
||||
internaciones,
|
||||
onAgregar,
|
||||
onActualizar,
|
||||
onEliminar
|
||||
onAgregar,
|
||||
onActualizar,
|
||||
onEliminar
|
||||
}: PacientesProps) {
|
||||
const [busqueda, setBusqueda] = useState('');
|
||||
const [dialogoAbierto, setDialogoAbierto] = useState(false);
|
||||
const [pacienteEditando, setPacienteEditando] = useState<Paciente | null>(null);
|
||||
|
||||
|
||||
// Formulario
|
||||
const [nombre, setNombre] = useState('');
|
||||
const [apellido, setApellido] = useState('');
|
||||
@@ -116,7 +116,7 @@ export function Pacientes({
|
||||
setDialogoAbierto(false);
|
||||
};
|
||||
|
||||
const pacientesFiltrados = pacientes.filter(p =>
|
||||
const pacientesFiltrados = pacientes.filter(p =>
|
||||
p.nombre.toLowerCase().includes(busqueda.toLowerCase()) ||
|
||||
p.apellido.toLowerCase().includes(busqueda.toLowerCase()) ||
|
||||
p.dni.includes(busqueda)
|
||||
@@ -162,33 +162,33 @@ export function Pacientes({
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<Label>Nombre *</Label>
|
||||
<Input
|
||||
value={nombre}
|
||||
<Input
|
||||
value={nombre}
|
||||
onChange={(e) => setNombre(e.target.value)}
|
||||
placeholder="Nombre del paciente"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label>Apellido *</Label>
|
||||
<Input
|
||||
value={apellido}
|
||||
<Input
|
||||
value={apellido}
|
||||
onChange={(e) => setApellido(e.target.value)}
|
||||
placeholder="Apellido del paciente"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label>DNI *</Label>
|
||||
<Input
|
||||
value={dni}
|
||||
<Input
|
||||
value={dni}
|
||||
onChange={(e) => setDni(e.target.value)}
|
||||
placeholder="Número de DNI"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label>Fecha de Nacimiento *</Label>
|
||||
<Input
|
||||
<Input
|
||||
type="date"
|
||||
value={fechaNacimiento}
|
||||
value={fechaNacimiento}
|
||||
onChange={(e) => setFechaNacimiento(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
@@ -215,24 +215,24 @@ export function Pacientes({
|
||||
</div>
|
||||
<div>
|
||||
<Label>Obra Social</Label>
|
||||
<Input
|
||||
value={obraSocial}
|
||||
<Input
|
||||
value={obraSocial}
|
||||
onChange={(e) => setObraSocial(e.target.value)}
|
||||
placeholder="Obra social del paciente"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label>Nacionalidad</Label>
|
||||
<Input
|
||||
value={nacionalidad}
|
||||
<Input
|
||||
value={nacionalidad}
|
||||
onChange={(e) => setNacionalidad(e.target.value)}
|
||||
placeholder="Nacionalidad del paciente"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label>Dirección</Label>
|
||||
<Input
|
||||
value={direccion}
|
||||
<Input
|
||||
value={direccion}
|
||||
onChange={(e) => setDireccion(e.target.value)}
|
||||
placeholder="Dirección del paciente"
|
||||
/>
|
||||
@@ -257,8 +257,8 @@ export function Pacientes({
|
||||
</div>
|
||||
<div className="sm:col-span-2">
|
||||
<Label>Teléfono Contacto</Label>
|
||||
<Input
|
||||
value={telefono}
|
||||
<Input
|
||||
value={telefono}
|
||||
onChange={(e) => setTelefono(e.target.value)}
|
||||
placeholder="Teléfono de contacto"
|
||||
/>
|
||||
@@ -300,12 +300,12 @@ export function Pacientes({
|
||||
Cancelar
|
||||
</Button>
|
||||
<Button variant="outline"
|
||||
onClick={handleGuardar}
|
||||
disabled={!nombre || !apellido || !dni || !fechaNacimiento}
|
||||
>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
{pacienteEditando ? 'Guardar Cambios' : 'Crear Paciente'}
|
||||
</Button>
|
||||
onClick={handleGuardar}
|
||||
disabled={!nombre || !apellido || !dni || !fechaNacimiento}
|
||||
>
|
||||
<Save className="h-4 w-4 mr-2" />
|
||||
{pacienteEditando ? 'Guardar Cambios' : 'Crear Paciente'}
|
||||
</Button>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
@@ -330,7 +330,7 @@ export function Pacientes({
|
||||
<div className="grid grid-cols-1 gap-4">
|
||||
{pacientesFiltrados.map((paciente) => (
|
||||
<Card key={paciente.id} className="hover:shadow-md transition-shadow">
|
||||
<CardContent className="p-4 dark:bg-gray-800">
|
||||
<CardContent className="p-4 dark:bg-gray-800">
|
||||
<div className="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4">
|
||||
<div className="flex items-start gap-4">
|
||||
<div className="h-12 w-12 bg-blue-100 rounded-full flex items-center justify-center flex-shrink-0">
|
||||
@@ -395,8 +395,8 @@ export function Pacientes({
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => handleEditar(paciente)}
|
||||
>
|
||||
@@ -418,7 +418,7 @@ export function Pacientes({
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancelar</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
<AlertDialogAction
|
||||
onClick={() => onEliminar(paciente.id)}
|
||||
className="bg-red-600 hover:bg-red-700"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user