import { Card } from '@mantine/core'; import { RefObject } from 'react'; import { useCardStyles } from '../../../layout/Common/useCardStyles'; import { WrapperContent } from '../WrapperContent'; import { useGridstack } from '../gridstack/use-gridstack'; interface DashboardSidebarProps extends DashboardSidebarInnerProps { location: 'right' | 'left'; isGridstackReady: boolean; } export const DashboardSidebar = ({ location, isGridstackReady }: DashboardSidebarProps) => { const { cx, classes: { card: cardClass }, } = useCardStyles(true); return ( {isGridstackReady && } ); }; interface DashboardSidebarInnerProps { location: 'right' | 'left'; } // Is Required because of the gridstack main area width. const SidebarInner = ({ location }: DashboardSidebarInnerProps) => { const { refs, apps, widgets } = useGridstack('sidebar', location); const minRow = useMinRowForFullHeight(refs.wrapper); return (
); }; const useMinRowForFullHeight = (wrapperRef: RefObject) => wrapperRef.current ? Math.floor(wrapperRef.current!.offsetHeight / 128) : 2;