2025-08-11 16:56:34 +01:00
|
|
|
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable"
|
|
|
|
|
import EntryBody from "@/components/EntryBody"
|
|
|
|
|
import EntryMetadata from "@/containers/EntryMetadata"
|
2025-11-21 13:38:18 +00:00
|
|
|
import { useIsMobile } from "@/hooks/use-mobile"
|
2025-08-11 16:56:34 +01:00
|
|
|
|
2025-11-07 15:55:32 +00:00
|
|
|
export default function Entry({ entryTitle, entryBody, history, metadata, isLoading }) {
|
2025-12-05 18:33:22 +00:00
|
|
|
const isMobile = useIsMobile()
|
2025-11-21 13:38:18 +00:00
|
|
|
|
2025-12-05 19:43:41 +00:00
|
|
|
const topPanelSize = isMobile ? 80 : 75
|
|
|
|
|
const bottomPanelSize = isMobile ? 20 : 25
|
2025-12-05 18:33:22 +00:00
|
|
|
const handleSize = isMobile ? "5px" : "1px"
|
|
|
|
|
return (
|
|
|
|
|
<ResizablePanelGroup direction="vertical" className="w-full h-full">
|
|
|
|
|
<ResizablePanel defaultSize={topPanelSize}>
|
|
|
|
|
<div className="h-full overflow-auto">
|
|
|
|
|
<EntryBody body={entryBody} isLoading={isLoading} />
|
|
|
|
|
</div>
|
|
|
|
|
</ResizablePanel>
|
|
|
|
|
<ResizableHandle withHandle style={{ height: handleSize }} />
|
2025-12-01 19:19:33 +00:00
|
|
|
|
2025-12-05 18:33:22 +00:00
|
|
|
<ResizablePanel key={`bottom-${bottomPanelSize}`} defaultSize={bottomPanelSize}>
|
|
|
|
|
<div className="h-full overflow-auto">
|
|
|
|
|
<EntryMetadata entryTitle={entryTitle} history={history} metadata={metadata} />
|
|
|
|
|
</div>
|
|
|
|
|
</ResizablePanel>
|
|
|
|
|
</ResizablePanelGroup>
|
|
|
|
|
)
|
2025-08-11 16:56:34 +01:00
|
|
|
}
|