File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11import { memo } from "react" ;
22import { useDefaults } from "../hooks/useDefaults" ;
33import { NO_TABLE_ENTRIES_YET_DEFAULTS , NoTableEntriesYetProps } from "../types/noTableEntriesYet" ;
4-
4+ import { Loading } from '@nextui-org/react' ;
55
66function GetNoTableEntriesYet ( _props : NoTableEntriesYetProps ) {
77 const [ props ] = useDefaults < NoTableEntriesYetProps > ( _props , NO_TABLE_ENTRIES_YET_DEFAULTS ) ;
88
99 return < tr >
1010 < td colSpan = { props . tableColumns } >
1111 < div className = { `flex justify-center items-center w-full text-sm ${ props . heightClass + " " + props . backgroundColorClass + " " + props . textColorClass + " " + props . marginBottomClass } ` } >
12- { props . text }
12+ { props . loading ?
13+ < div className = { `flex ${ props . loadingColorClass } ` } >
14+ < Loading size = "md" type = "spinner" color = "currentColor" />
15+ </ div >
16+ :
17+ props . text }
1318 </ div >
1419 </ td >
1520 </ tr >
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export type NoTableEntriesYetProps = {
1616 backgroundColorClass ?: string ;
1717 textColorClass ?: string ;
1818 marginBottomClass ?: string ; // can be used to offset common table paddings, usually negative
19+ loading ?: boolean
20+ loadingColorClass ?: string
1921}
2022
2123
@@ -25,4 +27,6 @@ export const NO_TABLE_ENTRIES_YET_DEFAULTS = {
2527 backgroundColorClass : 'bg-gray-50' ,
2628 textColorClass : 'text-gray-700' ,
2729 marginBottomClass : "" ,
30+ loading : false ,
31+ loadingColorClass : ''
2832}
You can’t perform that action at this time.
0 commit comments