Path: blob/master/src/packages/next/components/licenses/menu.tsx
1492 views
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Icon } from "@cocalc/frontend/components/icon";6import { Menu, MenuProps, Typography } from "antd";7import { useRouter } from "next/router";8const { Text } = Typography;910type MenuItem = Required<MenuProps>["items"][number];1112export default function ConfigMenu({ main }) {13const router = useRouter();1415const items: MenuItem[] = [16{ label: <Text strong>Licenses</Text>, key: "" },17{ label: "Manage", key: "managed", icon: <Icon name={"key"} /> },18{ label: "Projects", key: "projects", icon: <Icon name={"edit"} /> },19{ label: "How Used", key: "how-used", icon: <Icon name={"graph"} /> },20];2122function select(e) {23router.push(`/licenses/${e.keyPath[0]}`, undefined, {24scroll: false,25});26}2728return (29<Menu30mode="horizontal"31selectedKeys={[main]}32style={{ height: "100%", marginBottom: "24px" }}33onSelect={select}34items={items}35/>36);37}383940