@@ -20,29 +20,40 @@ import {
2020 getDatasetFile ,
2121 getDatasetInfo ,
2222 getDatasetFileFiltered ,
23- } from "../../../ api/datasets" ;
24- import DatasetTable from ".. /dataset/DatasetTable" ;
25- import { getComponents } from "../../../ api/component" ;
26- import { useTourContext } from "../.. /tour/TourProvider" ;
23+ } from "../api/datasets" ;
24+ import DatasetTable from "./notebooks /dataset/DatasetTable" ;
25+ import { getComponents } from "../api/component" ;
26+ import { useTourContext } from "./tour/TourProvider" ;
2727import { useSnackbar } from "notistack" ;
28- import JobQueueWidget from "../.. /jobs/JobQueueWidget" ;
29- import { getDatasetStatus } from "../../../ utils/datasetStatus" ;
30- import { formatDate } from "../../../ pages/results/constants/formatDate" ;
31- import Header from "./header/Header" ;
28+ import JobQueueWidget from "./jobs/JobQueueWidget" ;
29+ import { getDatasetStatus } from "../utils/datasetStatus" ;
30+ import { formatDate } from "../pages/results/constants/formatDate" ;
31+ import Header from "./notebooks/dataset/ header/Header" ;
3232import Tooltip from "@mui/material/Tooltip" ;
33- import OverviewTab from "./tabs/OverviewTab" ;
34- import { NumericTab } from "./tabs/NumericTab" ;
35- import { CategoricalTab } from "./tabs/CategoricalTab" ;
36- import QualityTab from "./tabs/QualityTab" ;
37- import CorrelationsTab from "./tabs/CorrelationsTab" ;
38- import { QualityAlerts } from "./QualityAlerts" ;
39- import { TextTab } from "./tabs/TextTab" ;
33+ import OverviewTab from "./notebooks/dataset/ tabs/OverviewTab" ;
34+ import { NumericTab } from "./notebooks/dataset/ tabs/NumericTab" ;
35+ import { CategoricalTab } from "./notebooks/dataset/ tabs/CategoricalTab" ;
36+ import QualityTab from "./notebooks/dataset/ tabs/QualityTab" ;
37+ import CorrelationsTab from "./notebooks/dataset/ tabs/CorrelationsTab" ;
38+ import { QualityAlerts } from "./notebooks/dataset/ QualityAlerts" ;
39+ import { TextTab } from "./notebooks/dataset/ tabs/TextTab" ;
4040
41+ /**
42+ * Component to visualize dataset information including quality metrics, statistics, and data preview.
43+ * Can be used across different modules (Notebooks, Models) with customizable action buttons.
44+ * @param {Object } props
45+ * @param {Object } props.dataset - Dataset object containing id, name, file_path, status, and created date
46+ * @param {Function } props.onItemCreated - Callback function when a new item (notebook/session) is created
47+ * @param {Function } props.onNewItem - Callback function when "New Item" button is clicked
48+ * @param {string } [props.newItemButtonText="New Item"] - Custom text for the action button (e.g., "New Notebook", "New Session")
49+ * @param {Array } [props.existingItems=[]] - Array of existing items (notebooks/sessions) for validation
50+ */
4151export default function DatasetVisualization ( {
4252 dataset,
43- onNotebookCreated,
44- onNewNotebook,
45- existingNotebooks = [ ] ,
53+ onItemCreated,
54+ onNewItem,
55+ newItemButtonText = "New Item" ,
56+ existingItems = [ ] ,
4657} ) {
4758 if ( ! dataset ) {
4859 return (
@@ -205,8 +216,8 @@ export default function DatasetVisualization({
205216 className = "new-notebook-button"
206217 onClick = { ( e ) => {
207218 e . stopPropagation ( ) ;
208- if ( onNewNotebook ) {
209- onNewNotebook ( ) ;
219+ if ( onNewItem ) {
220+ onNewItem ( ) ;
210221 }
211222 if ( tourContext && tourContext . run ) {
212223 setTimeout ( ( ) => {
@@ -216,7 +227,7 @@ export default function DatasetVisualization({
216227 } }
217228 sx = { { height : "40px" } }
218229 >
219- New Notebook
230+ { newItemButtonText }
220231 </ Button >
221232 </ Grid >
222233 </ Box >
0 commit comments