Files
standardnotes-app-web/app/assets/javascripts/Components/Preferences/PreferencesComponents/MenuItem.tsx
2022-05-20 23:20:05 +05:30

27 lines
700 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Icon } from '@/Components/Icon/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>
)