Files
standardnotes-app-web/app/assets/javascripts/Components/Preferences/PreferencesComponents/MenuItem.tsx
2022-04-13 22:02:34 +05:30

25 lines
592 B
TypeScript

import { Icon } from '@/Components/Icon'
import { FunctionComponent } from 'preact'
import { IconType } from '@standardnotes/snjs'
interface Props {
iconType: IconType
label: string
selected: boolean
onClick: () => void
}
export const MenuItem: FunctionComponent<Props> = ({ iconType, label, selected, onClick }) => (
<div
className={`preferences-menu-item select-none ${selected ? 'selected' : ''}`}
onClick={(e) => {
e.preventDefault()
onClick()
}}
>
<Icon className="icon" type={iconType} />
<div className="min-w-1" />
{label}
</div>
)