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/frontend/billing/invoice-history.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Virtuoso } from "react-virtuoso";6import { Panel } from "@cocalc/frontend/antd-bootstrap";7import { Icon, Loading } from "@cocalc/frontend/components";8import { Invoice } from "./invoice";9import { InvoicesMap, InvoiceMap } from "./types";1011interface Props {12invoices?: InvoicesMap;13}1415export default function InvoiceHistory({ invoices }: Props) {16return (17<Panel18header={19<span>20<Icon name="list-alt" /> Invoices and receipts21</span>22}23>24{invoices == null ? (25<Loading />26) : (27<div className={"smc-vfill"} style={{ height: "300px" }}>28<Virtuoso29totalCount={invoices.get("data").size}30itemContent={(index) => {31const invoice = invoices?.getIn(["data", index]);32if (invoice == null) {33// shouldn't happen34return <div style={{ height: "1px" }}></div>;35}36// LHS and RHS agree on type tooltip yet it errors without "as"37return (38<Invoice39key={invoice.get("id")}40invoice={invoice as InvoiceMap}41/>42);43}}44/>45</div>46)}47</Panel>48);49}505152