feat(F-162): completed feature

This commit is contained in:
chattie
2026-08-22 18:18:38 +02:00
parent 29c2a4495c
commit b1bbaa1055
11 changed files with 64 additions and 26 deletions

View File

@@ -6,6 +6,8 @@ import type { ProductVariant, StockAvailability, VariantPrice } from '@/types';
interface ProductRow {
productId: string;
productName: string;
productSlug: string;
productActive: boolean;
variant: ProductVariant;
stock: StockAvailability | null;
price: VariantPrice | null;
@@ -114,6 +116,8 @@ export default function InventoryPage() {
productRows.push({
productId: product.id,
productName: product.name,
productSlug: product.slug,
productActive: product.state === 'active',
variant,
stock: null,
price: null,
@@ -385,6 +389,7 @@ export default function InventoryPage() {
<th className="px-4 py-3 font-semibold text-gray-600 text-xs uppercase tracking-wide">Margen</th>
<th className="px-4 py-3 font-semibold text-gray-600 text-xs uppercase tracking-wide">Stock</th>
<th className="px-4 py-3 font-semibold text-gray-600 text-xs uppercase tracking-wide">Estado</th>
<th className="px-4 py-3 font-semibold text-gray-600 text-xs uppercase tracking-wide">Tienda</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-50">
@@ -535,6 +540,24 @@ export default function InventoryPage() {
<td className="px-4 py-3">
<StockBadge qty={row.stock?.availableQuantity ?? 0} />
</td>
<td className="px-4 py-3">
{row.productActive ? (
<a
href={`http://192.168.18.93:3003/products/${row.productSlug}`}
target="_blank"
rel="noopener noreferrer"
aria-label={`Ver ${row.productName} en la tienda`}
title="Ver en la tienda"
className="inline-flex h-8 w-8 items-center justify-center rounded-lg bg-green-50 text-green-600 transition-colors hover:bg-green-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#2D6A4F]"
>
<svg aria-hidden="true" className="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
<path strokeLinecap="round" strokeLinejoin="round" d="M10 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4M14 4h6m0 0v6m0-6L10 14" />
</svg>
</a>
) : (
<span className="text-gray-300"></span>
)}
</td>
</tr>
);
})}