返回 presentation-ai
indent-toolbar-button.tsx
根目录 / src / components / plate / ui / indent-toolbar-button.tsx
1 "use client";
2
3 import { useIndentButton, useOutdentButton } from "@platejs/indent/react";
4 import { IndentIcon, OutdentIcon } from "lucide-react";
5 import type * as React from "react";
6
7 import { ToolbarButton } from "./toolbar";
8
9 export function IndentToolbarButton(
10 props: React.ComponentProps<typeof ToolbarButton>,
11 ) {
12 const { props: buttonProps } = useIndentButton();
13
14 return (
15 <ToolbarButton {...props} {...buttonProps} tooltip="Indent">
16 <IndentIcon />
17 </ToolbarButton>
18 );
19 }
20
21 export function OutdentToolbarButton(
22 props: React.ComponentProps<typeof ToolbarButton>,
23 ) {
24 const { props: buttonProps } = useOutdentButton();
25
26 return (
27 <ToolbarButton {...props} {...buttonProps} tooltip="Outdent">
28 <OutdentIcon />
29 </ToolbarButton>
30 );
31 }
32
32 lines Plain Text