This commit is contained in:
2025-12-27 10:03:53 +07:00
parent 1805ff8674
commit e2063bce4c
18 changed files with 549 additions and 61 deletions

View File

@@ -4,16 +4,12 @@ import 'tippy.js/dist/tippy.css';
import { Product } from '@/types';
import Image from 'next/image';
import Link from 'next/link';
import { formatCurrency } from '@/lib/formatPrice';
type ProductItemProps = {
item: Product;
};
const formatCurrency = (value: number | string) => {
const num = typeof value === 'string' ? parseInt(value) : value;
return num.toLocaleString('vi-VN');
};
const ItemProduct: React.FC<ProductItemProps> = ({ item }) => {
const offers = item.specialOffer?.all ?? [];