Files
wehub-resource-sync 2114b14ee0
Sync main into demo / sync (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:35:26 +08:00

11 lines
455 B
TypeScript

import React from 'react';
export const Switch: React.FC<{ value: boolean; onChange: (value: boolean) => void }> = ({ value, onChange }) => (
<button
onClick={() => onChange(!value)}
className={`w-11 h-6 rounded-full p-0.5 transition-colors ${value ? 'bg-app-primary' : 'bg-gray-200'}`}
>
<div className={`w-5 h-5 rounded-full bg-app-surface shadow-sm transition-transform ${value ? 'translate-x-5' : 'translate-x-0'}`} />
</button>
);