import clsx from 'clsx'; import { useState } from 'react'; import { Check } from 'lucide-react'; import { Checkbox } from '@@/form-components/Checkbox'; import { Icon } from '@@/Icon'; import styles from './TableSettingsMenuAutoRefresh.module.css'; interface Props { onChange(value: number): void; value: number; } export function TableSettingsMenuAutoRefresh({ onChange, value }: Props) { const [isCheckVisible, setIsCheckVisible] = useState(false); const isEnabled = value > 0; return ( <> onChange(e.target.checked ? 10 : 0)} /> {isEnabled && (
setIsCheckVisible(false)} >
)} ); function handleChange(value: string) { onChange(Number(value)); setIsCheckVisible(true); } }