import React from 'react'; import type { StyleProp, ViewProps, ViewStyle } from 'react-native'; import SegmentedItem from './SegmentedItem'; import { StyledSegmentedControlWrapper } from './StyledSegmentedControl'; import type { SegmentedControlItemConfig } from './types'; export interface SegmentedControlProps extends ViewProps { /** * The size of the segmented control. */ size?: 'medium' | 'large'; /** * The items to display in the segmented control. */ items: SegmentedControlItemConfig[]; /** * The value of the selected item. */ value: string; /** * Test ID for testing purposes. */ testID?: string; /** * The style of the segmented control. */ style?: StyleProp; /** * The callback function to be called when the selected item changes. */ onItemPress: (item: SegmentedControlItemConfig) => void; } const SegmentedControl = ({ size = 'medium', items, value, testID, style, onItemPress, }: SegmentedControlProps) => { return ( {items.map((item) => ( onItemPress(item)} size={size} /> ))} ); }; export default SegmentedControl;