import { Menu } from "@mantine/core"; import { IconType } from "react-icons"; import { TiTick } from "react-icons/ti"; import { MouseEvent } from "react"; export type ToolbarDropdownItemProps = { text: string; icon?: IconType; onClick?: (e: MouseEvent) => void; isSelected?: boolean; isDisabled?: boolean; }; export function ToolbarDropdownItem(props: ToolbarDropdownItemProps) { const ItemIcon = props.icon; return ( } rightSection={ props.isSelected ? ( ) : ( // Ensures space for tick even if item isn't currently selected.
) } disabled={props.isDisabled}> {props.text} ); }