import { IconButton, Spinner, SpinnerSize } from "@fluentui/react";
import * as React from "react";
import { NotebookUtil } from "../NotebookUtil";
import { PassedPromptProps } from "./Prompt";
import "./Prompt.less";
export const promptContent = (props: PassedPromptProps): JSX.Element => {
if (props.status === "busy") {
const stopButtonText = "Stop cell execution";
return (
);
} else if (props.isHovered) {
const playButtonText = props.isRunDisabled ? NotebookUtil.UntrustedNotebookRunHint : "Run cell";
return (
);
} else {
return {promptText(props)}
;
}
};
/**
* Generate what text goes inside the prompt based on the props to the prompt
*/
const promptText = (props: PassedPromptProps): string => {
if (props.status === "busy") {
return "[*]";
}
if (props.status === "queued") {
return "[…]";
}
if (typeof props.executionCount === "number") {
return `[${props.executionCount}]`;
}
return "[ ]";
};