import { useState } from 'react' import { UnitInput, UnitInputSize, UnitPosition } from '../../../Inputs' const UnitInputLightHouse = () => { const [price, setPrice] = useState(undefined) const [discount, setDiscount] = useState(10) const [weight, setWeight] = useState(75.5) return (
{/* Basic UnitInput */} setPrice( e.target.value ? parseFloat(e.target.value) : undefined ) } min={0} step={0.01} /> {/* Prefilled / typical states */} setPrice( e.target.value ? parseFloat(e.target.value) : undefined ) } hintText="Enter the price in US dollars" required /> {/* Percentage discount */} setDiscount( e.target.value ? parseFloat(e.target.value) : undefined ) } min={0} max={100} step={1} /> {/* Error state */} {}} min={0} max={100} error errorMessage="Discount must be between 0% and 100%" /> {/* Weight with unit on right */} setWeight( e.target.value ? parseFloat(e.target.value) : undefined ) } placeholder="0.0" min={0} step={0.1} /> {/* Disabled examples */} {}} placeholder="This input is disabled" disabled /> {}} disabled /> {/* Size variants */} {}} placeholder="Medium unit input" /> {}} placeholder="Large unit input" />
) } export default UnitInputLightHouse