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/apply-license-to-project.tsx
Views: 687
/*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 { Alert, Button, Popconfirm } from "antd";7import { NextRouter } from "next/router";8import { useLicenseProject } from "./util";9import Project from "components/project/link";1011interface ApplyLicenseToProjectProps {12router: NextRouter;13}1415export const ApplyLicenseToProject: React.FC<ApplyLicenseToProjectProps> = (16props: ApplyLicenseToProjectProps17) => {18const { router } = props;19const { upgradeProjectId, upgradeProjectDelete } = useLicenseProject(router);2021function body(): JSX.Element {22if (!upgradeProjectId) throw new Error("should never happen");23return (24<div>25After purchase, this license will applied to project{" "}26<Project project_id={upgradeProjectId} /> automatically.27</div>28);29}3031if (!upgradeProjectId) return null;3233return (34<Alert35type="info"36message={body()}37style={{ marginBottom: "20px" }}38action={39<Popconfirm40placement="bottomRight"41title={42<div style={{ maxWidth: "400px" }}>43Are you sure you want to cancel automatically applying the license44to the project after purchasing it? Don't forget to apply the45license manually.46</div>47}48onConfirm={upgradeProjectDelete}49okText="Yes, cancel"50cancelText="No"51>52<Button size="small" type="link">53<Icon name="times" />54</Button>55</Popconfirm>56}57/>58);59};606162