mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 09:16:22 +02:00
19 lines
489 B
TypeScript
19 lines
489 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>
|
|
);
|
|
}
|