import type { CSSProperties } from 'react' import { Minus, Plus } from 'lucide-react' import { useTranslation } from '../../i18n' import { Tooltip } from '../shared/Tooltip' interface PackedCounterProps { packed: number quantity: number onChange: (count: number) => void style?: CSSProperties } const stepStyle: CSSProperties = { width: 18, height: 18, display: 'grid', placeItems: 'center', padding: 0, border: 'none', borderRadius: 99, background: 'transparent', color: 'var(--text-muted)', cursor: 'pointer', } /** * How many pieces of a multi-piece item are already in the bag (#2296): "7/10" * between a minus and a plus. Reaching the quantity ticks the item off. */ export function PackedCounter({ packed, quantity, onChange, style }: PackedCounterProps) { const { t } = useTranslation() const partial = packed > 0 && packed < quantity return (
{packed}/{quantity}
) }