Initial Move from Azure DevOps to GitHub

This commit is contained in:
Steve Faulkner
2020-05-25 21:30:55 -05:00
commit 36581fb6d9
986 changed files with 195242 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
import * as React from "react";
import { IconButton } from "office-ui-fabric-react/lib/Button";
import { Spinner, SpinnerSize } from "office-ui-fabric-react/lib/Spinner";
import "./Prompt.less";
import { PassedPromptProps } from "./Prompt";
export const promptContent = (props: PassedPromptProps): JSX.Element => {
if (props.status === "busy") {
const stopButtonText: string = "Stop cell execution";
return (
<div
style={{ position: "sticky", width: "100%", maxHeight: "100%", left: 0, top: 0, zIndex: 300 }}
className={props.isHovered ? "" : "greyStopButton"}
>
<IconButton
className="runCellButton"
iconProps={{ iconName: "CircleStopSolid" }}
title={stopButtonText}
ariaLabel={stopButtonText}
onClick={props.stopCell}
style={{ position: "absolute" }}
/>
<Spinner size={SpinnerSize.large} style={{ position: "absolute", width: "100%", paddingTop: 5 }} />
</div>
);
} else if (props.isHovered) {
const playButtonText: string = "Run cell";
return (
<IconButton
className="runCellButton"
iconProps={{ iconName: "MSNVideosSolid" }}
title={playButtonText}
ariaLabel={playButtonText}
onClick={props.runCell}
/>
);
} else {
return <div style={{ paddingTop: 7 }}>{promptText(props)}</div>;
}
};
/**
* 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 "[ ]";
};