import { RtFrame, RtUse } from '@dpa/react-frame-intro'; import { RtToggle, RtToggleProps } from '@dpa/react-toggle'; import { useState } from 'react'; function ToggleGroup({ uses, radius, timeout, }: { uses: RtUse[]; radius: RtToggleProps['radius']; timeout?: boolean; }) { const [isActive, setIsActive] = useState(false); const [isLoading, setIsLoading] = useState(false); const handleChange: RtToggleProps['onChange'] = ({ value }) => { console.log('value', value); setIsLoading(true); setTimeout( () => { setIsLoading(false); setIsActive(value); }, timeout ? 250 : 0 ); }; return (
{uses.map((use) => ( ))}
); } export function TogglePage() { return ( ); }