feat(F-086): completed feature

This commit is contained in:
chattie
2026-08-20 06:13:37 +02:00
parent 7ece045e13
commit 822bc7546c
16 changed files with 201 additions and 27 deletions

View File

@@ -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>