Vitron-Front/app/components/product/SizeSelector.tsx
2026-04-29 01:44:16 +03:30

34 lines
948 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

interface SizeSelectorProps {
sizes: string[] | undefined;
selectedSize: string | null;
setSelectedSize: (size: string) => void;
}
export const SizeSelector = ({
sizes,
selectedSize,
setSelectedSize,
}: SizeSelectorProps) => (
<div className="flex flex-col gap-4 mt-10 px-4">
<p className="text-B18 font-bold">انتخاب سایز</p>
<div className="gap-4 flex">
{sizes?.map((size: string, index: number) => (
<div
key={index}
className={`w-10 h-10 rounded-md flex border border-BLACK border-inner-border items-center justify-center ${
selectedSize === size
? "bg-BLACK text-WHITE"
: "bg-WHITE text-BLACK"
}`}
onClick={() => setSelectedSize(size)}
onKeyDown={() => {}}
role="button"
tabIndex={0}
>
<p className="text-R12">{size}</p>
</div>
))}
</div>
</div>
);