import { ToogleSwitch } from "../shared/toogle-switch.component"; type Item = { text: string; desc?: string; checked?: boolean; onChange?: (isChecked: boolean) => void|Promise; }; type Props = { items: Item[]; }; export function SettingToogleSwitchGrid({ items }: Readonly) { const handleItemChange = (item: Item, state: boolean) => { item.onChange?.(state); }; return (
{items.map((item) => (

{item.text}

{item.desc}

handleItemChange(item, checked)}/>
))}
) }