mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 09:16:22 +02:00
29 lines
640 B
TypeScript
29 lines
640 B
TypeScript
'use client';
|
|
|
|
import * as React from 'react';
|
|
|
|
import { useMarkToolbarButton, useMarkToolbarButtonState } from 'platejs/react';
|
|
|
|
import { ToolbarButton } from './toolbar';
|
|
|
|
export function MarkToolbarButton({
|
|
clear,
|
|
nodeType,
|
|
...props
|
|
}: React.ComponentProps<typeof ToolbarButton> & {
|
|
nodeType: string;
|
|
clear?: string[] | string;
|
|
}) {
|
|
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
const { props: buttonProps } = useMarkToolbarButton(state);
|
|
|
|
return (
|
|
<ToolbarButton
|
|
{...props}
|
|
{...buttonProps}
|
|
onMouseDown={(e: React.MouseEvent) => {
|
|
e.preventDefault();
|
|
}}
|
|
/>
|
|
);
|
|
}
|