import { useContext } from 'react';
import SwitchComp, { type SwitchProps } from '../../switch';
import { useListItemControl } from '../useListItemControl';
import { ListItemContext } from '../ListItemContext';
export type ListItemSwitchProps = Omit<
SwitchProps,
'disabled' | 'id' | 'aria-labelledby' | 'aria-label'
>;
/**
* This component allows for rendering a switch control within a fully interactive ListItem.
It's a thin wrapper around the
* [CheckboxButton component](https://storybook.wise.design/?path=/docs/actions-switch--docs),
* but offers only a subset of its features in line with the ListItem's constraints.
*
* Please refer to the [Design documentation](https://wise.design/components/list-item---switch) for details.
*/
export const Switch = function (props: ListItemSwitchProps) {
const { baseItemProps } = useListItemControl('switch', { ...props });
const { ids, describedByIds } = useContext(ListItemContext);
return (
);
};
Switch.displayName = 'ListItem.Switch';