feat(F-086): completed feature
This commit is contained in:
@@ -186,6 +186,9 @@ export default function ProductsPage() {
|
||||
<th className="text-left text-xs font-semibold text-gray-500 uppercase tracking-wide px-4 py-3">
|
||||
Marca
|
||||
</th>
|
||||
<th className="text-left text-xs font-semibold text-gray-500 uppercase tracking-wide px-4 py-3">
|
||||
Caducidad
|
||||
</th>
|
||||
<th className="text-left text-xs font-semibold text-gray-500 uppercase tracking-wide px-4 py-3">
|
||||
Estado
|
||||
</th>
|
||||
@@ -232,6 +235,27 @@ export default function ProductsPage() {
|
||||
<td className="px-4 py-3">
|
||||
<p className="text-sm text-gray-600">{p.brand?.name ?? '—'}</p>
|
||||
</td>
|
||||
<td className="px-4 py-3">
|
||||
{p.expirationDate ? (
|
||||
(() => {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const exp = new Date(p.expirationDate);
|
||||
const expired = exp < today;
|
||||
return (
|
||||
<span
|
||||
className={`text-sm ${expired ? 'text-red-600 font-semibold' : 'text-gray-600'}`}
|
||||
title={expired ? 'Producto caducado' : 'Caduca el'}
|
||||
>
|
||||
{expired ? '⚠ ' : ''}
|
||||
{exp.toLocaleDateString('es-ES')}
|
||||
</span>
|
||||
);
|
||||
})()
|
||||
) : (
|
||||
<span className="text-sm text-gray-400">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="px-4 py-3">
|
||||
<StateBadge state={p.state} />
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user