Files
standardnotes-app-web/app/assets/javascripts/preferences/components/MenuItem.tsx
Vardan Hakobyan bf382ce0f8 feat: get editor icons and their colors from snjs (#828)
* feat: get editor icons and their colors from snjs

* feat: get icons and their tints from snjs

* fix: use IconType from snjs
2022-01-31 18:58:36 +04:00

30 lines
611 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>
);