import { FileOutlined, HighlightOutlined, SolutionOutlined, ToolOutlined, UserOutlined } from "@ant-design/icons"; import { IResourceComponentsProps, useTranslate } from "@refinedev/core"; import { Menu, theme } from "antd"; import { Content } from "antd/es/layout/layout"; import dayjs from "dayjs"; import utc from "dayjs/plugin/utc"; import React from "react"; import { Route, Routes, useNavigate } from "react-router-dom"; import { ExtraFieldsSettings } from "./extraFieldsSettings"; import { GeneralSettings } from "./generalSettings"; dayjs.extend(utc); const { useToken } = theme; export const Settings: React.FC = () => { const { token } = useToken(); const t = useTranslate(); const navigate = useNavigate(); const getCurrentKey = () => { const path = window.location.pathname.replace("/settings", ""); // Remove starting slash and ending slash if exists and return return path.replace(/^\/|\/$/g, ""); }; return ( <>

{t("settings.header")}

{ if (e.key === "") { return navigate("/settings"); } else { return navigate(`/settings/${e.key}`); } }} items={[ { key: "", label: t("settings.general.tab"), icon: }, { key: "extra", label: t("settings.extra_fields.tab"), icon: , children: [ { label: t("spool.spool"), key: "extra/spool", icon: , }, { label: t("filament.filament"), key: "extra/filament", icon: , }, { label: t("vendor.vendor"), key: "extra/vendor", icon: , }, ], }, ]} style={{ marginBottom: "1em", }} />
} /> } />
); }; export default Settings;