|
|
@@ -1,8 +1,8 @@
|
|
|
import { Tab, Tabs } from "@nextui-org/react";
|
|
|
import React, { useMemo, useState } from "react";
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
-import { FaCode } from "react-icons/fa6";
|
|
|
import { IoIosGlobe } from "react-icons/io";
|
|
|
+import { VscCode } from "react-icons/vsc";
|
|
|
import Calendar from "../assets/calendar";
|
|
|
import { I18nKey } from "../i18n/declaration";
|
|
|
import { AllTabs, TabOption, TabType } from "../types/TabOption";
|
|
|
@@ -23,7 +23,7 @@ function Workspace() {
|
|
|
},
|
|
|
[TabOption.CODE]: {
|
|
|
name: t(I18nKey.WORKSPACE$CODE_EDITOR_TAB_LABEL),
|
|
|
- icon: <FaCode size={18} />,
|
|
|
+ icon: <VscCode size={18} />,
|
|
|
component: <CodeEditor key="code" />,
|
|
|
},
|
|
|
[TabOption.BROWSER]: {
|
|
|
@@ -36,31 +36,31 @@ function Workspace() {
|
|
|
);
|
|
|
|
|
|
return (
|
|
|
- <>
|
|
|
+ <div className="flex flex-col min-h-0 grow">
|
|
|
<div
|
|
|
role="tablist"
|
|
|
- className="tabs tabs-bordered tabs-lg border-b border-neutral-600"
|
|
|
+ className="tabs tabs-bordered tabs-lg border-b border-neutral-600 flex"
|
|
|
>
|
|
|
<Tabs
|
|
|
disableCursorAnimation
|
|
|
classNames={{
|
|
|
+ base: "w-full",
|
|
|
tabList:
|
|
|
- "w-full relative rounded-none bg-neutral-800 p-0 border-divider gap-0 h-[36px]",
|
|
|
- cursor: "w-full bg-neutral-800 rounded-none",
|
|
|
- tab: " rounded-none border-neutral-600 border-r-[1px] border-r",
|
|
|
+ "w-full relative rounded-none bg-neutral-900 p-0 gap-0 h-[36px] flex",
|
|
|
+ tab: "rounded-none border-neutral-600 data-[selected=true]:bg-neutral-800",
|
|
|
tabContent: "group-data-[selected=true]:text-neutral-50",
|
|
|
}}
|
|
|
- variant="light"
|
|
|
size="lg"
|
|
|
onSelectionChange={(v) => {
|
|
|
setActiveTab(v as TabType);
|
|
|
}}
|
|
|
>
|
|
|
- {AllTabs.map((tab) => (
|
|
|
+ {AllTabs.map((tab, index) => (
|
|
|
<Tab
|
|
|
key={tab}
|
|
|
+ className={`flex-grow ${index + 1 === AllTabs.length ? "" : "border-r"}`}
|
|
|
title={
|
|
|
- <div className="flex items-center space-x-2 justify-center text-xs">
|
|
|
+ <div className="flex grow items-center gap-2 justify-center text-xs">
|
|
|
{tabData[tab].icon}
|
|
|
<span>{tabData[tab].name}</span>
|
|
|
</div>
|
|
|
@@ -69,16 +69,10 @@ function Workspace() {
|
|
|
))}
|
|
|
</Tabs>
|
|
|
</div>
|
|
|
- {Object.keys(tabData).map((tab) => (
|
|
|
- <div
|
|
|
- className="h-full w-full bg-neutral-800"
|
|
|
- key={tab}
|
|
|
- hidden={activeTab !== tab}
|
|
|
- >
|
|
|
- {tabData[tab as TabType].component}
|
|
|
- </div>
|
|
|
- ))}
|
|
|
- </>
|
|
|
+ <div className="grow w-full bg-neutral-800 flex min-h-0">
|
|
|
+ {tabData[activeTab as TabType].component}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
);
|
|
|
}
|
|
|
export default Workspace;
|