Path: blob/master/src/packages/frontend/course/common/run-all-popover.tsx
10799 views
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Button, Popover } from "antd";6import type { ReactNode } from "react";78import { Icon } from "@cocalc/frontend/components";910interface RunAllPopoverProps {11id: string;12open: boolean;13onOpenChange: (next: boolean) => void;14type: "primary" | "default";15content: ReactNode | (() => ReactNode);16ariaLabel: string;17}1819export function RunAllPopover({20id,21open,22onOpenChange,23type,24content,25ariaLabel,26}: RunAllPopoverProps) {27return (28<Popover29key={id}30placement="bottom"31trigger="click"32destroyOnHidden33open={open}34onOpenChange={onOpenChange}35content={content}36overlayInnerStyle={{ maxWidth: 545 }}37>38<span style={{ display: "inline-block" }}>39<Button40type={type}41size="small"42icon={<Icon name="forward" />}43aria-label={ariaLabel}44/>45</span>46</Popover>47);48}495051