mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-07 02:58:11 +00:00
29 lines
611 B
TypeScript
29 lines
611 B
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
|
|
import { withRef } from '@udecode/cn';
|
|
import {
|
|
useLinkToolbarButton,
|
|
useLinkToolbarButtonState,
|
|
} from '@udecode/plate-link/react';
|
|
import { Link } from 'lucide-react';
|
|
|
|
import { ToolbarButton } from './toolbar';
|
|
|
|
export const LinkToolbarButton = withRef<typeof ToolbarButton>((rest, ref) => {
|
|
const state = useLinkToolbarButtonState();
|
|
const { props } = useLinkToolbarButton(state);
|
|
|
|
return (
|
|
<ToolbarButton
|
|
ref={ref}
|
|
data-plate-focus
|
|
tooltip="Link"
|
|
{...props}
|
|
{...rest}
|
|
>
|
|
<Link />
|
|
</ToolbarButton>
|
|
);
|
|
});
|