mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-07 02:58:11 +00:00
24 lines
574 B
TypeScript
24 lines
574 B
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
|
|
import { withRef } from '@udecode/cn';
|
|
import {
|
|
useMarkToolbarButton,
|
|
useMarkToolbarButtonState,
|
|
} from '@udecode/plate-common/react';
|
|
|
|
import { ToolbarButton } from './toolbar';
|
|
|
|
export const MarkToolbarButton = withRef<
|
|
typeof ToolbarButton,
|
|
{
|
|
nodeType: string;
|
|
clear?: string[] | string;
|
|
}
|
|
>(({ clear, nodeType, ...rest }, ref) => {
|
|
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
const { props } = useMarkToolbarButton(state);
|
|
|
|
return <ToolbarButton ref={ref} {...props} {...rest} />;
|
|
});
|