Reformat cod e

This commit is contained in:
CHIEFSOFT\ameye
2025-10-06 16:29:54 -04:00
parent f86e5abd3d
commit bd4cdb1ae9
+16 -7
View File
@@ -65,19 +65,25 @@ export default function ProductsCom() {
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'> <div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
<Icons name='filter' className='text-3xl'/> <Icons name='filter' className='text-3xl'/>
<div className='w-full sm:max-w-48'> <div className='w-full sm:max-w-48'>
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}> <select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
onChange={handleFilter}>
<option value=''>All</option> <option value=''>All</option>
<option value='name'>Name</option> <option value='name'>Name</option>
</select> </select>
</div> </div>
<div className='w-full sm:max-w-48'> <div className='w-full sm:max-w-48'>
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} /> <input name='id' value={filter?.id} disabled={!filter.type}
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
onChange={handleFilter}/>
</div> </div>
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button> <button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
</button>
</div> </div>
{/* end of filter section */} {/* end of filter section */}
<TablePaginatedWrapper data={productsData} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}> <TablePaginatedWrapper data={productsData} isFetching={isFetching} setPage={setPage}
itemsPerPage={pagination?.limit} pagination={pagination}>
{({data}) => ( {({data}) => (
<> <>
<table className="py-2 w-full text-sm"> <table className="py-2 w-full text-sm">
@@ -104,9 +110,11 @@ export default function ProductsCom() {
{(data && data.length > 0) ? data?.map((item, index) => ( {(data && data.length > 0) ? data?.map((item, index) => (
<tr key={index} className="py-2 border-t border-dashed border-slate-300"> <tr key={index} className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2"> <td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'> <div
className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
<div className="text-left"> <div className="text-left">
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div> <div
className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
</div> </div>
</div> </div>
</td> </td>
@@ -117,7 +125,8 @@ export default function ProductsCom() {
</td> </td>
<td className="px-2"> <td className="px-2">
<div className="text-left"> <div className="text-left">
<div className="text-base font-semibold">{item?.product_id}</div> <div
className="text-base font-semibold">{item?.product_id}</div>
</div> </div>
</td> </td>
<td className="px-2"> <td className="px-2">