mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-23 01:54:55 +02:00
23 lines
610 B
TypeScript
23 lines
610 B
TypeScript
import React from "react";
|
|
|
|
import { FirstPageOutlined, MenuOutlined } from "@mui/icons-material";
|
|
import { IconButton } from "@mui/material";
|
|
|
|
import {
|
|
toggleSamplesDrawerOpen,
|
|
useSamplesDrawerOpen
|
|
} from "../../documents/editor/EditorContext";
|
|
|
|
function useIcon() {
|
|
const samplesDrawerOpen = useSamplesDrawerOpen();
|
|
if (samplesDrawerOpen) {
|
|
return <FirstPageOutlined fontSize="small" />;
|
|
}
|
|
return <MenuOutlined fontSize="small" />;
|
|
}
|
|
|
|
export default function ToggleSamplesPanelButton() {
|
|
const icon = useIcon();
|
|
return <IconButton onClick={toggleSamplesDrawerOpen}>{icon}</IconButton>;
|
|
}
|