mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 08:46:22 +02:00
19 lines
471 B
TypeScript
19 lines
471 B
TypeScript
"use client";
|
|
|
|
import { BookOpenIcon, PenLineIcon } from "lucide-react";
|
|
import { usePlateState } from "platejs/react";
|
|
|
|
import { ToolbarButton } from "./toolbar";
|
|
|
|
export function ModeToolbarButton() {
|
|
const [readOnly, setReadOnly] = usePlateState("readOnly");
|
|
|
|
return (
|
|
<ToolbarButton
|
|
tooltip={readOnly ? "Click to edit" : "Click to view"}
|
|
onClick={() => setReadOnly(!readOnly)}
|
|
>
|
|
{readOnly ? <BookOpenIcon /> : <PenLineIcon />}
|
|
</ToolbarButton>
|
|
);
|
|
}
|