22import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
33import { Paging } from "@neolution-ch/react-pattern-ui" ;
44import { flexRender } from "@tanstack/react-table" ;
5- import { Spinner , Table as ReactStrapTable , Input } from "reactstrap" ;
5+ import { Table as ReactStrapTable , Input } from "reactstrap" ;
66import { reactDataTableTranslations } from "../translations/translations" ;
77import { ReactDataTableProps } from "./ReactDataTableProps" ;
88
@@ -26,14 +26,35 @@ const ReactDataTable = <TData,>(props: ReactDataTableProps<TData>) => {
2626
2727 const { pagination } = table . getState ( ) ;
2828
29+ const loadingCss = `
30+ @-webkit-keyframes reloadingAnimation {
31+ 0%{
32+ background-position-x: 200%
33+ }
34+ 100%{
35+ background-position-x: 0%
36+ }
37+ }` ;
38+
2939 return (
3040 < >
31- { ! isLoading && isFetching && (
32- < Spinner color = "primary" type = "grow" >
33- Loading...
34- </ Spinner >
35- ) }
36- < ReactStrapTable striped hover size = "sm" className = { tableClassName } style = { tableStyle } >
41+ < style > { loadingCss } </ style >
42+ < ReactStrapTable
43+ striped
44+ hover
45+ size = "sm"
46+ className = { tableClassName }
47+ style = {
48+ ! isLoading && isFetching
49+ ? {
50+ ...tableStyle ,
51+ background : "linear-gradient(90deg, #E8E8E8, #ffffff, #E8E8E8)" ,
52+ backgroundSize : "200% 200%" ,
53+ animation : "reloadingAnimation 3s linear infinite" ,
54+ }
55+ : tableStyle
56+ }
57+ >
3758 < thead >
3859 { table . getHeaderGroups ( ) . map ( ( headerGroup ) => (
3960 < >
0 commit comments