buster/apps/web/src/components/ui/report/MarkToolbarButtons.tsx

22 lines
553 B
TypeScript
Raw Normal View History

2025-07-29 01:35:20 +08:00
'use client';
import * as React from 'react';
import { useMarkToolbarButton, useMarkToolbarButtonState } from 'platejs/react';
2025-08-02 07:40:39 +08:00
import { ToolbarButton } from '@/components/ui/toolbar/Toolbar';
2025-07-29 01:35:20 +08:00
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} />;
}