| 1 | "use client"; |
| 2 | |
| 3 | import { useMarkToolbarButton, useMarkToolbarButtonState } from "platejs/react"; |
| 4 | import type * as React from "react"; |
| 5 | |
| 6 | import { ToolbarButton } from "./toolbar"; |
| 7 | |
| 8 | export function MarkToolbarButton({ |
| 9 | clear, |
| 10 | nodeType, |
| 11 | ...props |
| 12 | }: React.ComponentProps<typeof ToolbarButton> & { |
| 13 | nodeType: string; |
| 14 | clear?: string[] | string; |
| 15 | }) { |
| 16 | const state = useMarkToolbarButtonState({ clear, nodeType }); |
| 17 | const { props: buttonProps } = useMarkToolbarButton(state); |
| 18 | |
| 19 | return <ToolbarButton {...props} {...buttonProps} />; |
| 20 | } |
| 21 |