Spaces:
Paused
Paused
File size: 1,059 Bytes
3c3f089 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import React, { ReactNode } from "react";
import { Allotment } from "allotment";
import { LayoutPriority } from "allotment/dist/types/src/split-view";
interface Pane {
panelA: ReactNode;
panelB: ReactNode;
panelC: ReactNode;
lastPanelVisibility: boolean;
}
const EditorPanel = ({ panelA, panelB, panelC, lastPanelVisibility }: Pane) => {
return (
<div style={{ height: "calc(100vh - 8rem)" }}>
<Allotment>
<Allotment.Pane>{panelA}</Allotment.Pane>
<Allotment onVisibleChange={function noRefCheck() {}} vertical={true}>
<Allotment.Pane
priority={"HIGH" as LayoutPriority}
preferredSize="70%"
visible
>
{panelB}
</Allotment.Pane>
<Allotment.Pane
preferredSize="30%"
priority={"LOW" as LayoutPriority}
snap
visible={lastPanelVisibility}
>
{panelC}
</Allotment.Pane>
</Allotment>
</Allotment>
</div>
);
};
export default EditorPanel;
|