2026-02-17 12:47:39 +05:30
|
|
|
"use client";
|
2026-02-16 00:11:34 +05:30
|
|
|
|
2026-02-17 12:47:39 +05:30
|
|
|
import { useMarkToolbarButton, useMarkToolbarButtonState } from "platejs/react";
|
2026-02-20 22:44:56 -08:00
|
|
|
import type * as React from "react";
|
2026-02-16 00:11:34 +05:30
|
|
|
|
2026-02-17 12:47:39 +05:30
|
|
|
import { ToolbarButton } from "./toolbar";
|
2026-02-16 00:11:34 +05:30
|
|
|
|
|
|
|
|
export function MarkToolbarButton({
|
2026-02-17 12:47:39 +05:30
|
|
|
clear,
|
|
|
|
|
nodeType,
|
|
|
|
|
...props
|
2026-02-16 00:11:34 +05:30
|
|
|
}: React.ComponentProps<typeof ToolbarButton> & {
|
2026-02-17 12:47:39 +05:30
|
|
|
nodeType: string;
|
|
|
|
|
clear?: string[] | string;
|
2026-02-16 00:11:34 +05:30
|
|
|
}) {
|
2026-02-17 12:47:39 +05:30
|
|
|
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
|
|
|
const { props: buttonProps } = useMarkToolbarButton(state);
|
2026-02-16 00:11:34 +05:30
|
|
|
|
2026-02-17 12:47:39 +05:30
|
|
|
return (
|
|
|
|
|
<ToolbarButton
|
|
|
|
|
{...props}
|
|
|
|
|
{...buttonProps}
|
|
|
|
|
onMouseDown={(e: React.MouseEvent) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
);
|
2026-02-16 00:11:34 +05:30
|
|
|
}
|