| 1 | "use client"; |
| 2 | |
| 3 | import { |
| 4 | useToggleToolbarButton, |
| 5 | useToggleToolbarButtonState, |
| 6 | } from "@platejs/toggle/react"; |
| 7 | import { ListCollapseIcon } from "lucide-react"; |
| 8 | import type * as React from "react"; |
| 9 | |
| 10 | import { ToolbarButton } from "./toolbar"; |
| 11 | |
| 12 | export function ToggleToolbarButton( |
| 13 | props: React.ComponentProps<typeof ToolbarButton>, |
| 14 | ) { |
| 15 | const state = useToggleToolbarButtonState(); |
| 16 | const { props: buttonProps } = useToggleToolbarButton(state); |
| 17 | |
| 18 | return ( |
| 19 | <ToolbarButton {...props} {...buttonProps} tooltip="Toggle"> |
| 20 | <ListCollapseIcon /> |
| 21 | </ToolbarButton> |
| 22 | ); |
| 23 | } |
| 24 |