Files
standardnotes-app/app/assets/javascripts/Components/Preferences/PreferencesComponents/MenuItem.tsx
T
Mo fdf290ea1a feat: error decrypting preferences section (#990)
* feat: error decrypting preferences section

* chore: upgrade snjs
2022-04-21 10:33:59 -05:00

33 lines
706 B
TypeScript

import { Icon } from '@/Components/Icon'
import { FunctionComponent } from 'preact'
import { IconType } from '@standardnotes/snjs'
interface Props {
iconType: IconType
label: string
selected: boolean
hasBubble?: boolean
onClick: () => void
}
export const MenuItem: FunctionComponent<Props> = ({
iconType,
label,
selected,
onClick,
hasBubble,
}) => (
<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}
{hasBubble && <span className="ml-1 color-warning">⚠️</span>}
</div>
)