Files
page-assist/src/components/Layouts/Layout.tsx

46 lines
1.2 KiB
TypeScript
Raw Normal View History

import React, { useState } from "react"
import { Sidebar } from "../Option/Sidebar"
2024-05-31 13:50:05 +05:30
import { Drawer } from "antd"
2024-03-24 12:43:43 +05:30
import { useTranslation } from "react-i18next"
2024-05-31 13:50:05 +05:30
import { CurrentChatModelSettings } from "../Common/Settings/CurrentChatModelSettings"
2024-05-31 13:50:05 +05:30
import { Header } from "./Header"
export default function OptionLayout({
children
}: {
children: React.ReactNode
}) {
const [sidebarOpen, setSidebarOpen] = useState(false)
2024-03-24 21:00:00 +05:30
const { t } = useTranslation(["option", "common"])
const [openModelSettings, setOpenModelSettings] = useState(false)
return (
2024-05-31 13:50:05 +05:30
<>
<div className="flex flex-col min-h-screen">
<Header
setSidebarOpen={setSidebarOpen}
setOpenModelSettings={setOpenModelSettings}
/>
<main className="flex-1 flex flex-col ">{children}</main>
</div>
<Drawer
2024-03-24 12:43:43 +05:30
title={t("sidebarTitle")}
placement="left"
closeIcon={null}
onClose={() => setSidebarOpen(false)}
open={sidebarOpen}>
2024-03-24 12:43:43 +05:30
<Sidebar onClose={() => setSidebarOpen(false)} />
</Drawer>
<CurrentChatModelSettings
open={openModelSettings}
setOpen={setOpenModelSettings}
/>
2024-05-31 13:50:05 +05:30
</>
)
}