Fix table node

This commit is contained in:
Nate Kelley 2025-08-02 10:26:27 -06:00
parent 700e8f50a7
commit f32a41b048
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 10 additions and 6 deletions

View File

@ -44,7 +44,8 @@ import {
BucketPaint2, BucketPaint2,
SquareLayoutGrid4, SquareLayoutGrid4,
Trash2, Trash2,
Xmark Xmark,
SquareLayoutGrid
} from '@/components/ui/icons'; } from '@/components/ui/icons';
import { import {
type TElement, type TElement,
@ -183,7 +184,7 @@ function TableFloatingToolbar({ children, ...props }: React.ComponentProps<typeo
<DropdownMenu modal={false}> <DropdownMenu modal={false}>
<DropdownMenuTrigger> <DropdownMenuTrigger>
<ToolbarButton tooltip="Cell borders"> <ToolbarButton tooltip="Cell borders">
<Grid2X2 /> <SquareLayoutGrid />
</ToolbarButton> </ToolbarButton>
</DropdownMenuTrigger> </DropdownMenuTrigger>
@ -264,9 +265,12 @@ function TableFloatingToolbar({ children, ...props }: React.ComponentProps<typeo
); );
} }
function TableBordersDropdownMenuContent( // TableBordersDropdownMenuContent is now a forwardRef functional component
props: React.ComponentProps<typeof DropdownMenuPrimitive.Content> const TableBordersDropdownMenuContent = React.forwardRef<
) { React.ElementRef<typeof DropdownMenuPrimitive.Content>,
React.ComponentProps<typeof DropdownMenuPrimitive.Content>
>(function TableBordersDropdownMenuContent(props, ref) {
// Get the current editor instance
const editor = useEditorRef(); const editor = useEditorRef();
const { const {
getOnSelectTableBorder, getOnSelectTableBorder,
@ -333,7 +337,7 @@ function TableBordersDropdownMenuContent(
</DropdownMenuGroup> </DropdownMenuGroup>
</DropdownMenuContent> </DropdownMenuContent>
); );
} });
function ColorDropdownMenu({ children, tooltip }: { children: React.ReactNode; tooltip: string }) { function ColorDropdownMenu({ children, tooltip }: { children: React.ReactNode; tooltip: string }) {
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);