Path: blob/master/src/packages/next/components/billing/menu.tsx
1450 views
/*1* This file is part of CoCalc: Copyright © 2021 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();1415function select(e) {16router.push(`/billing/${e.keyPath[0]}`, undefined, {17scroll: false,18});19}2021const items: MenuItem[] = [22{ label: <Text strong>Billing</Text>, key: "" },23{ label: "Cards", key: "cards", icon: <Icon name={"credit-card"} /> },24{25label: "Invoices and Receipts",26key: "receipts",27icon: <Icon name={"list"} />,28},29{30label: "Subscriptions",31key: "subscriptions",32icon: <Icon name={"calendar"} />,33},34];3536return (37<Menu38mode="horizontal"39selectedKeys={[main]}40style={{ height: "100%", marginBottom: "24px" }}41onSelect={select}42items={items}43/>44);45}464748