'use client'; import * as React from 'react'; import { useToggleButton, useToggleButtonState } from '@platejs/toggle/react'; import { ChevronRightIcon } from 'lucide-react'; import { type PlateElementProps, PlateElement } from 'platejs/react'; import { cn } from '@/lib/utils'; export function ToggleElement({ children, ...props }: PlateElementProps) { const element = props.element; const state = useToggleButtonState(element.id as string); const { buttonProps, open } = useToggleButton(state); return (
{children}
); }