Workspaces layout, automation page
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
import { toast } from 'sonner';
|
||||
import { useClient } from 'hooks/useClient';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Widget } from '@/components/Widget';
|
||||
import { Widget } from 'widgets/Widget';
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog';
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
||||
@@ -1,52 +1,24 @@
|
||||
import { useUserState } from '@/state/useUserState';
|
||||
import { WorkspaceView } from '@/components/Workspace';
|
||||
import { useState } from 'react';
|
||||
import type { LayoutNode } from '@/components/Workspace';
|
||||
import { widgetRegistry } from '@/Screens/Dashboard/Workspaces/widget-registry';
|
||||
import { WorkspaceLayout } from '@/components/Workspace';
|
||||
import { appRegistry } from '../Workspaces/app-registry';
|
||||
|
||||
const DEFAULT_HOME_LAYOUT: LayoutNode = {
|
||||
const initialLayout: LayoutNode = {
|
||||
type: 'group',
|
||||
id: 'home-root',
|
||||
direction: 'horizontal',
|
||||
direction: 'vertical',
|
||||
children: [
|
||||
{
|
||||
size: 50,
|
||||
node: {
|
||||
type: 'group',
|
||||
id: 'home-left',
|
||||
direction: 'vertical',
|
||||
children: [
|
||||
{ size: 50, node: { type: 'panel', id: 'home-tl', widgetType: null } },
|
||||
{ size: 50, node: { type: 'panel', id: 'home-bl', widgetType: null } },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
size: 50,
|
||||
node: {
|
||||
type: 'group',
|
||||
id: 'home-right',
|
||||
direction: 'vertical',
|
||||
children: [
|
||||
{ size: 50, node: { type: 'panel', id: 'home-tr', widgetType: null } },
|
||||
{ size: 50, node: { type: 'panel', id: 'home-br', widgetType: null } },
|
||||
],
|
||||
},
|
||||
},
|
||||
{ node: { type: 'panel', id: 'homepage-widget-panel', appType: 'widget-panel' }, size: 60 },
|
||||
{ node: { type: 'panel', id: 'home-bottom', appType: 'chat-launcher' }, size: 40 },
|
||||
],
|
||||
};
|
||||
|
||||
export const HomeScreen = () => {
|
||||
const [layout, setLayout] = useUserState<LayoutNode>('home-workspace-layout', DEFAULT_HOME_LAYOUT);
|
||||
const [layout, setLayout] = useState<LayoutNode>(initialLayout);
|
||||
|
||||
return (
|
||||
<div className="h-full w-full">
|
||||
<WorkspaceView
|
||||
workspace={null}
|
||||
name="Home"
|
||||
layout={layout}
|
||||
onLayoutChange={setLayout}
|
||||
registry={widgetRegistry}
|
||||
/>
|
||||
<WorkspaceLayout layout={layout} onLayoutChange={setLayout} registry={appRegistry} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user