changes: Detail link view by shoe size

This commit is contained in:
2025-10-13 00:01:44 -06:00
parent 4b1a47cb83
commit cf3467e4dd

View File

@@ -52,8 +52,8 @@ export default function ShoeResultsPopup({ isOpen, onOpenChange, detectedSKU }:
const handleViewDetails = () => {
if (product?.linkText) {
window.open(`https://www.impuls.com.mx/${product.linkText}/p`, '_blank');
if (product?.linkText && selectedVariant) {
window.open(`https://www.impuls.com.mx/${product.linkText}/p?skuId=${selectedVariant}`, '_blank');
}
};
@@ -293,10 +293,10 @@ export default function ShoeResultsPopup({ isOpen, onOpenChange, detectedSKU }:
${variant.price}
</span>
)}
<Badge
<Badge
variant={isOutOfStock ? "secondary" : "default"}
className={`text-xs ${
stockInfo.status === 'out_of_stock'
stockInfo.status === 'out_of_stock'
? 'bg-red-500/20 text-red-300 border-red-500/30'
: stockInfo.status === 'low_stock'
? 'bg-yellow-500/20 text-yellow-300 border-yellow-500/30'
@@ -307,10 +307,25 @@ export default function ShoeResultsPopup({ isOpen, onOpenChange, detectedSKU }:
>
{stockInfo.label}
</Badge>
{isSelected && (
<Button
size="sm"
onClick={() => {
if (product?.linkText && variant.itemId) {
window.open(`https://www.impuls.com.mx/${product.linkText}/p?skuId=${variant.itemId}`, '_blank');
}
}}
className="bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 border-0 shadow-md text-xs px-3 py-1 h-auto animate-in fade-in slide-in-from-right-5 duration-500 ease-out"
>
<ExternalLink className="w-3 h-3 mr-1" />
Ver Detalle
</Button>
)}
</div>
{isSelected && (
<div className="ml-2 w-2 h-2 bg-blue-400 rounded-full"></div>
<div className="ml-2 w-2 h-2 bg-blue-400 rounded-full animate-in fade-in zoom-in duration-300"></div>
)}
</div>
);
@@ -378,7 +393,8 @@ export default function ShoeResultsPopup({ isOpen, onOpenChange, detectedSKU }:
<Button
size="lg"
onClick={handleViewDetails}
className="flex-1 min-h-[48px] h-12 sm:h-14 text-base sm:text-lg bg-gradient-to-r from-blue-600 to-purple-600 active:from-blue-700 active:to-purple-700 border-0 shadow-lg shadow-blue-500/25 active:scale-[0.98] transition-all duration-200"
disabled={!selectedVariant}
className="flex-1 min-h-[48px] h-12 sm:h-14 text-base sm:text-lg bg-gradient-to-r from-blue-600 to-purple-600 active:from-blue-700 active:to-purple-700 border-0 shadow-lg shadow-blue-500/25 active:scale-[0.98] transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed"
aria-label="Ver detalles completos del producto"
>
<ExternalLink className="w-4 h-4 sm:w-5 sm:h-5 mr-2" />