@datalayer/core
Version:
**Datalayer Core**
23 lines (22 loc) • 1.01 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
/*
* Copyright (c) 2023-2025 Datalayer, Inc.
* Distributed under the terms of the Modified BSD License.
*/
/*
* Copyright (c) 2021-2023 Datalayer, Inc.
*
* MIT License
*/
import { useMemo } from 'react';
import { Box } from '@datalayer/primer-addons';
import { Notebook2, NotebookToolbar, CellSidebarExtension, CellSidebarButton } from '@datalayer/jupyter-react';
const NOTEBOOK_ID = 'notebook-example-1';
export const NotebookExample = (props) => {
const { kernel, serviceManager } = props;
const extensions = useMemo(() => [
new CellSidebarExtension({ factory: CellSidebarButton })
], []);
return (_jsxs(_Fragment, { children: [_jsx(Box, { as: "h1", children: "A Jupyter Notebook" }), _jsx(Notebook2, { path: "ipywidgets.ipynb", id: NOTEBOOK_ID, serviceManager: serviceManager, kernelId: kernel.id, extensions: extensions, Toolbar: NotebookToolbar })] }));
};
export default NotebookExample;