import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Label } from '@/components/ui/label' import { Input } from '@/components/ui/input' import { Button } from '@/components/ui/button' import { Skeleton } from '@/components/ui/skeleton' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import type { QuantitySelectorDefaults } from '../../hooks/use-selector-defaults' interface Props { settings: QuantitySelectorDefaults | null onChange: (settings: QuantitySelectorDefaults) => void loading: boolean error: string | null onRetry: () => void } export function ProductDefaultsTab({settings, onChange, loading, error, onRetry}: Props) { if (loading) return
if (error || !settings) return

{error || 'Product defaults are unavailable.'}

const set = (key: K, value: QuantitySelectorDefaults[K]) => onChange({...settings, [key]: value}) return
Product-page quantity selectorDefaults for products using “Use dashboard default.” Product-specific overrides stay unchanged.
{settings.display !== 'input' && <>
set('width', Number(event.target.value))}/>
{settings.choice_source === 'custom' &&
set('choices', event.target.value)} aria-describedby="quantity-default-choices-help"/>

Comma-separated whole quantities. Choices outside the product’s limits or stock are hidden; purchasing rules do not change.

}
set('suffix', event.target.value)}/>

For example, “items” displays “6 items.”

}

Classic product forms only. Automatic choices need a finite maximum and no more than 100 options; otherwise the original number input stays available. Cart and Checkout Blocks keep their native selectors.

Role-specific quantities, customer purchase limits, product spend limits and category exclusions remain in each product’s Product data → Quantity Limits panel.

}