-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #391 from meaningfy-ws/feature/MWB12-34
feature/MWB12-34
- Loading branch information
Showing
7 changed files
with
114 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
mapping_workbench/frontend/src/sections/components/table-load-wrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Alert from '@mui/material/Alert'; | ||
import Skeleton from '@mui/material/Skeleton'; | ||
import Stack from '@mui/material/Stack'; | ||
|
||
export const TableLoadWrapper = ({children, data, dataState, lines}) => { | ||
if (dataState.load) return <TableSkeleton lines={lines}/> | ||
if (dataState.error) return <TableErrorFetching/> | ||
if (!data.length) return <TableNoData/> | ||
return children | ||
} | ||
|
||
|
||
export const TableSkeleton = ({lines = 5}) => { | ||
return <div> | ||
{new Array(lines).fill("").map((e, i) => | ||
<Skeleton key={'line' + i} | ||
height={50}/>)} | ||
</div> | ||
} | ||
|
||
export const TableNoData = () => { | ||
return <Stack justifyContent="center" | ||
direction="row"> | ||
<Alert severity="info">No Data !</Alert> | ||
</Stack> | ||
} | ||
|
||
export const TableErrorFetching = () => { | ||
return <Stack justifyContent="center" | ||
direction="row"> | ||
<Alert severity="error">Error on fetching data !</Alert> | ||
</Stack> | ||
} |