Add gridstack dashboard layout

This commit is contained in:
Meierschlumpf
2022-12-10 22:14:31 +01:00
parent b7bb1302e4
commit 001890d763
39 changed files with 2822 additions and 918 deletions

View File

@@ -1,24 +1,29 @@
import { Group, Stack } from '@mantine/core';
import { useMemo } from 'react';
import { useConfigContext } from '../../../config/provider';
import { ServiceTile } from '../Tiles/Service/Service';
import { CategoryType } from '../../../types/category';
import { WrapperType } from '../../../types/wrapper';
import { DashboardCategory } from '../Wrappers/Category/Category';
import { DashboardSidebar } from '../Wrappers/Sidebar/Sidebar';
import { DashboardWrapper } from '../Wrappers/Wrapper/Wrapper';
export const DashboardView = () => {
const wrappers = useWrapperItems();
const clockModule = useConfigContext().config?.integrations.clock;
return (
<Group align="top" h="100%">
{/*<DashboardSidebar location="left" />*/}
<DashboardSidebar location="left" />
<Stack mx={-10} style={{ flexGrow: 1 }}>
{wrappers.map(
(item) =>
item.type === 'category'
? 'category' //<DashboardCategory key={item.id} category={item as unknown as CategoryType} />
: 'wrapper' //<DashboardWrapper key={item.id} wrapper={item as WrapperType} />
{wrappers.map((item) =>
item.type === 'category' ? (
<DashboardCategory key={item.id} category={item as unknown as CategoryType} />
) : (
<DashboardWrapper key={item.id} wrapper={item as WrapperType} />
)
)}
</Stack>
{/*<DashboardSidebar location="right" />*/}
<DashboardSidebar location="right" />
</Group>
);
};