Add APIClientProvider to widget

This commit is contained in:
porink0424
2024-07-10 18:15:35 +09:00
parent 7c0b18f744
commit 52f7d62215
+9 -1
View File
@@ -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() {
@@ -9,6 +13,10 @@ export class OptunaDashboardWidget extends ReactWidget {
}
render(): JSX.Element {
return <JupyterLabEntrypoint />;
return (
<APIClientProvider apiClient={jupyterlabAPIClient}>
<JupyterLabEntrypoint />
</APIClientProvider>
);
}
}