Skip to content

Commit

Permalink
Add APIClientProvider to widget
Browse files Browse the repository at this point in the history
  • Loading branch information
porink0424 committed Jul 10, 2024
1 parent 7c0b18f commit 52f7d62
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion jupyterlab/src/widget.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { ReactWidget } from '@jupyterlab/ui-components';
import React from 'react';
import { JupyterLabEntrypoint } from './components/JupyterLabEntrypoint';
import { JupyterlabAPIClient } from './apiClient';
import { APIClientProvider } from '@optuna/optuna-dashboard';

const jupyterlabAPIClient = new JupyterlabAPIClient();

export class OptunaDashboardWidget extends ReactWidget {
constructor() {
Expand All @@ -9,6 +13,10 @@ export class OptunaDashboardWidget extends ReactWidget {
}

render(): JSX.Element {
return <JupyterLabEntrypoint />;
return (
<APIClientProvider apiClient={jupyterlabAPIClient}>
<JupyterLabEntrypoint />
</APIClientProvider>
);
}
}

0 comments on commit 52f7d62

Please sign in to comment.