5a824c2eee
75 components + DESIGN_SYSTEM.md + sync script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
40 lines
753 B
TypeScript
40 lines
753 B
TypeScript
import { SegmentedControl } from '@mantine/core'
|
|
import type { MantineSize, MantineColor } from '@mantine/core'
|
|
|
|
interface SegmentedItem {
|
|
value: string
|
|
label: string
|
|
}
|
|
|
|
interface FnSegmentedControlProps {
|
|
data: SegmentedItem[]
|
|
value?: string
|
|
onChange?: (value: string) => void
|
|
fullWidth?: boolean
|
|
size?: MantineSize
|
|
color?: MantineColor
|
|
}
|
|
|
|
function FnSegmentedControl({
|
|
data,
|
|
value,
|
|
onChange,
|
|
fullWidth = false,
|
|
size = 'sm',
|
|
color,
|
|
}: FnSegmentedControlProps) {
|
|
return (
|
|
<SegmentedControl
|
|
data={data}
|
|
value={value}
|
|
onChange={onChange}
|
|
fullWidth={fullWidth}
|
|
size={size}
|
|
color={color}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export { FnSegmentedControl }
|
|
export type { FnSegmentedControlProps, SegmentedItem }
|