import * as React from 'react'; import ReactSwitch from 'react-switch'; import { State } from '~/store/types'; import { getTheme } from '../store/app'; import { connect } from './StateProvider'; // workaround https://github.com/vitejs/vite/issues/2139#issuecomment-802981228 // @ts-ignore const Switch = ReactSwitch.default ? ReactSwitch.default : ReactSwitch; function SwitchThemed({ checked = false, onChange, theme, name }) { const offColor = theme === 'dark' ? '#393939' : '#e9e9e9'; const onColor = theme === 'dark' ? '#306081' : '#005caf'; return ( ); } export default connect((s: State) => ({ theme: getTheme(s) }))(SwitchThemed);