Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

94 рядки
3.3 KiB

  1. // material-ui
  2. import {
  3. Grid,
  4. Typography,
  5. Stack
  6. } from '@mui/material';
  7. import MainCard from "components/MainCard";
  8. import * as React from "react";
  9. import * as DateUtils from "utils/DateUtils";
  10. import Loadable from 'components/Loadable';
  11. const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
  12. const SearchForm = Loadable(React.lazy(() => import('./SearchForm')));
  13. const EventTable = Loadable(React.lazy(() => import('./DataGrid')));
  14. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  15. import { FormattedMessage } from "react-intl";
  16. const BackgroundHead = {
  17. backgroundImage: `url(${titleBackgroundImg})`,
  18. width: '100%',
  19. height: '100%',
  20. backgroundSize: 'contain',
  21. backgroundRepeat: 'no-repeat',
  22. backgroundColor: '#0C489E',
  23. backgroundPosition: 'right'
  24. }
  25. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  26. const UserSearchPage_Individual = () => {
  27. const [searchCriteria, setSearchCriteria] = React.useState({
  28. dateTo: DateUtils.dateValue(new Date()),
  29. dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate() - 90)),
  30. });
  31. const [onReady, setOnReady] = React.useState(false);
  32. const [onGridReady, setGridOnReady] = React.useState(false);
  33. React.useEffect(() => {
  34. setOnReady(true);
  35. }, [searchCriteria]);
  36. function applySearch(input) {
  37. setGridOnReady(true)
  38. setSearchCriteria(input);
  39. }
  40. function applyGridOnReady(input) {
  41. setGridOnReady(input);
  42. }
  43. return (
  44. !onReady ?
  45. <Grid container sx={{ minHeight: '95vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
  46. <Grid item>
  47. <LoadingComponent />
  48. </Grid>
  49. </Grid>
  50. :
  51. <Grid container sx={{ minHeight: '95vh',backgroundColor: 'backgroundColor.default' }} direction="column">
  52. <Grid item xs={12}>
  53. <div style={BackgroundHead}>
  54. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  55. <Typography ml={15} color='#FFF' variant="h4" sx={{ "textShadow": "0px 0px 25px #0C489E" }}><FormattedMessage id="announcement" /></Typography>
  56. </Stack>
  57. </div>
  58. </Grid>
  59. {/*row 1*/}
  60. <Grid item xs={12} md={12} lg={12} sx={{mb: -1}}>
  61. <SearchForm
  62. applySearch={applySearch}
  63. searchCriteria={searchCriteria}
  64. onGridReady={onGridReady}
  65. />
  66. </Grid>
  67. {/*row 2*/}
  68. <Grid item xs={12} md={12} lg={12}>
  69. <MainCard elevation={0}
  70. border={false}
  71. content={false}
  72. sx={{ backgroundColor: '#fff' }}
  73. >
  74. <EventTable
  75. searchCriteria={searchCriteria}
  76. applyGridOnReady={applyGridOnReady}
  77. />
  78. </MainCard>
  79. </Grid>
  80. </Grid>
  81. );
  82. }
  83. export default UserSearchPage_Individual;