2024-08-05 22:36:05 +05:30
|
|
|
import { useState } from 'react'
|
2024-08-04 22:47:43 +05:30
|
|
|
|
2024-08-05 22:36:05 +05:30
|
|
|
import { LayoutFilled, ProductFilled, CloudUploadOutlined } from "@ant-design/icons"
|
2024-08-04 22:47:43 +05:30
|
|
|
|
2024-08-05 22:36:05 +05:30
|
|
|
import Sidebar from './sidebar/sidebar'
|
|
|
|
|
import WidgetsContainer from './sidebar/widgetsContainer'
|
|
|
|
|
import UploadsContainer from './sidebar/uploadsContainer'
|
2024-08-08 16:21:19 +05:30
|
|
|
import Canvas from './canvas/canvas'
|
2024-08-04 12:08:30 +05:30
|
|
|
|
|
|
|
|
function App() {
|
2024-08-04 22:47:43 +05:30
|
|
|
|
2024-08-05 22:36:05 +05:30
|
|
|
const [uploadedAssets, setUploadedAssets] = useState([]) // a global storage for assets, since redux can't store files(serialize files)
|
|
|
|
|
|
|
|
|
|
|
2024-08-04 22:47:43 +05:30
|
|
|
const tabs = [
|
|
|
|
|
{
|
|
|
|
|
name: "Widgets",
|
|
|
|
|
icon: <LayoutFilled />,
|
|
|
|
|
content: <WidgetsContainer />
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Extensions",
|
|
|
|
|
icon: <ProductFilled />,
|
|
|
|
|
content: <></>
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Uploads",
|
|
|
|
|
icon: <CloudUploadOutlined />,
|
2024-08-05 22:36:05 +05:30
|
|
|
content: <UploadsContainer assets={uploadedAssets}
|
|
|
|
|
onAssetUploadChange={(assets) => setUploadedAssets(assets)}/>
|
2024-08-04 22:47:43 +05:30
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
2024-08-04 12:08:30 +05:30
|
|
|
return (
|
2024-08-04 22:47:43 +05:30
|
|
|
<div className="tw-w-full tw-h-[100vh] tw-flex tw-bg-primaryBg">
|
|
|
|
|
|
|
|
|
|
<Sidebar tabs={tabs}/>
|
2024-08-05 22:36:05 +05:30
|
|
|
<Canvas />
|
2024-08-04 12:08:30 +05:30
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default App;
|