mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-10-13 23:38:45 +01:00
* Tighten notebook code cell output sandbox * Enable sandboxnotebookoutputs by default * Address feedback
27 lines
564 B
TypeScript
27 lines
564 B
TypeScript
import { Media } from "@nteract/outputs";
|
|
import React from "react";
|
|
|
|
interface Props {
|
|
/**
|
|
* The JavaScript code that we would like to execute.
|
|
*/
|
|
data: string;
|
|
/**
|
|
* The media type associated with our component.
|
|
*/
|
|
mediaType: "text/javascript";
|
|
}
|
|
|
|
export class SandboxJavaScript extends React.PureComponent<Props> {
|
|
static defaultProps = {
|
|
data: "",
|
|
mediaType: "application/javascript",
|
|
};
|
|
|
|
render(): JSX.Element {
|
|
return <Media.HTML data={`<script>${this.props.data}</script>`} />;
|
|
}
|
|
}
|
|
|
|
export default SandboxJavaScript;
|