import { WebApplication } from '@/ui_models/application'; import { SNTheme } from '@standardnotes/snjs'; import { FunctionComponent } from 'preact'; import { JSXInternal } from 'preact/src/jsx'; import { Switch } from '../Switch'; type Props = { theme: SNTheme; application: WebApplication; onBlur: (event: { relatedTarget: EventTarget | null }) => void; }; export const ThemesMenuButton: FunctionComponent = ({ application, theme, onBlur, }) => { const toggleTheme: JSXInternal.MouseEventHandler = (e) => { e.preventDefault(); if (theme.isLayerable() || !theme.active) { application.toggleComponent(theme); } }; return ( ); };