fixed SearchDate

This commit is contained in:
2026-01-16 15:47:16 -06:00
parent 13fd1113ba
commit f859d4e8d8
7 changed files with 51 additions and 27 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import axios from "axios";
import { SetStateAction, useEffect, useState } from "react";
import { useEffect, useState } from "react";
import { envConfig } from "../lib/config";
interface mesas {
View File
+3 -3
View File
@@ -11,7 +11,7 @@ interface Recibo {
fecha_registro: string;
monto: string;
user: {
nombre: string;
usuario: string;
};
}
@@ -72,7 +72,7 @@ function PorRecibos({ desde, hasta }: Props) {
<tbody>
{!loading && recibos.length === 0 && (
<tr>
<td colSpan={2}>No hay recibos en este rango</td>
<td colSpan={5}>No hay recibos en este rango</td>
</tr>
)}
@@ -82,7 +82,7 @@ function PorRecibos({ desde, hasta }: Props) {
<td>${Number(recibo.monto).toFixed(2)}</td>
<td>{recibo.fecha_recibo}</td>
<td>{recibo.fecha_registro}</td>
<td>{recibo.user.nombre}</td>
<td>{recibo.user.usuario}</td>
</tr>
))}
</tbody>
@@ -0,0 +1,11 @@
.containerDate{
gap: 10px;
width: 100%;
max-width: 100%;
}
.alingDate{
display: flex;
justify-content: flex-start;
gap: 10px;
}
@@ -1,14 +1,15 @@
'use client';
"use client";
import { useState } from 'react';
import { useState } from "react";
import "./SearchDate.css";
interface Props {
onSearch: (desde: string, hasta: string) => void;
}
function SearchDateBetween({ onSearch }: Props) {
const [startDate, setStartDate] = useState('');
const [endDate, setEndDate] = useState('');
const [startDate, setStartDate] = useState("");
const [endDate, setEndDate] = useState("");
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
@@ -17,26 +18,37 @@ function SearchDateBetween({ onSearch }: Props) {
};
return (
<form className="containerForm" onSubmit={handleSubmit}>
<label className="label">Desde</label>
<div className="groupInput">
<input
type="date"
value={startDate}
onChange={(e) => setStartDate(e.target.value)}
/>
<form className="containerForm containerDate" onSubmit={handleSubmit}>
<div className="alingDate">
<div className="">
<label className="label">Desde</label>
<div className="groupInput">
<input
type="date"
value={startDate}
onChange={(e) => setStartDate(e.target.value)}
/>
</div>
</div>
<div>
<label className="label">Hasta</label>
<div className="groupInput">
<input
type="date"
value={endDate}
onChange={(e) => setEndDate(e.target.value)}
/>
</div>
</div>
</div>
<label className="label">Hasta</label>
<div className="groupInput">
<input
type="date"
value={endDate}
onChange={(e) => setEndDate(e.target.value)}
/>
</div>
<button className="button buttonSearch" type="submit" style={{marginBottom:"10px"}}>
<button
className="button buttonSearch"
type="submit"
style={{ marginBottom: "10px" }}
>
Buscar
</button>
</form>
+1
View File
@@ -44,3 +44,4 @@ export default function SelectAreas(props: proms) {
</div>
);
}
//IO
+1 -1
View File
@@ -15,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsx": "preserve",
"incremental": true,
"plugins": [
{