Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/components/store/link.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Button } from "antd";6import { useRouter } from "next/router";78import { Icon } from "@cocalc/frontend/components/icon";9import { Uptime } from "@cocalc/util/consts/site-license";1011export interface StoreConf {12run_limit: number;13disk: number;14ram: number;15cpu: number;16user: "academic" | "business";17start?: Date;18end?: Date;19uptime: Uptime;20period?: "monthly" | "yearly" | "range";21}2223interface Props {24conf?: StoreConf;25}2627const STYLE: React.CSSProperties = {28fontSize: "150%",29fontWeight: "bold",30textAlign: "center",31marginTop: "30px",32} as const;3334export function LinkToStore(props: Props) {35const { conf } = props;3637const router = useRouter();3839const params =40conf != null41? Object.entries(conf)42.map(([key, value]) => `${key}=${value}`)43.join("&")44: "";4546const url = `/store/site-license?${params}`;4748const label = conf != null ? "Select" : `Store`;4950return (51<div style={STYLE}>52<Button53size={"large"}54type={"primary"}55onClick={() => router.push(url)}56icon={<Icon name="shopping-cart" />}57>58{label}59</Button>60</div>61);62}636465