Add side actions for insertin new / editing blocks
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
28
packages/ui/src/RichEditor/MenuButton.tsx
Normal file
28
packages/ui/src/RichEditor/MenuButton.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { tv } from "tailwind-variants";
|
||||
|
||||
const menuButtonVariants = tv({
|
||||
base: ["px-2 py-1 text-sm rounded-sm font-semibold bg-level-0 hover:bg-subtle"],
|
||||
variants: {
|
||||
active: {
|
||||
true: ["bg-active"],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
type MenuButtonProps = {
|
||||
label: string;
|
||||
active?: boolean;
|
||||
onClick: () => void;
|
||||
};
|
||||
|
||||
export function MenuButton({ label, active, onClick }: MenuButtonProps) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
className={menuButtonVariants({ active })}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user