|
- // material-ui
- import {
- Grid,
- Typography,
- Stack,
- Button,
- } from '@mui/material';
- import * as UrlUtils from "utils/ApiPathConst";
- import * as React from "react";
- import * as HttpUtils from "utils/HttpUtils";
-
- import Loadable from 'components/Loadable';
- const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
- const EmailTemplateTable = Loadable(React.lazy(() => import('pages/EmailTemplate/Search_GLD/DataGrid')))
- import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
- import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';
- import MainCard from 'components/MainCard';
- const BackgroundHead = {
- backgroundImage: `url(${titleBackgroundImg})`,
- width: '100%',
- height: '100%',
- backgroundSize: 'contain',
- backgroundRepeat: 'no-repeat',
- backgroundColor: '#0C489E',
- backgroundPosition: 'right'
- }
- import { useNavigate } from "react-router";
-
- // ==============================|| DASHBOARD - DEFAULT ||============================== //
-
- const Index = () => {
-
- const [record, setRecord] = React.useState([]);
- const [onReady, setOnReady] = React.useState(false);
- const navigate = useNavigate()
-
- React.useLayoutEffect(() => {
- loadForm();
- }, []);
-
- React.useLayoutEffect(() => {
- setOnReady(true);
- }, [record]);
-
- const loadForm = () => {
- HttpUtils.get({
- url: UrlUtils.GET_EMAIL_LIST,
- onSuccess: (responseData) => {
- setRecord(responseData);
- }
- });
- }
-
- return (
- !onReady ?
- <LoadingComponent />
- :
- (
- <Grid container sx={{ minHeight: '110vh', backgroundColor: 'backgroundColor.default' }} direction="column" justifyContent="flex-start" alignItems="center" >
- <Grid item xs={12} width="100%">
- <div style={BackgroundHead} width="100%">
- <Stack direction="row" height='70px'>
- <Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>Email Template</Typography>
- </Stack>
- </div>
- </Grid>
- {/*row 1*/}
- <Grid item xs={12} md={12} lg={12} width="100%">
- <MainCard elevation={0}
- border={false}
- content={false}
- >
- <EmailTemplateTable
- recordList={record}
- />
- </MainCard>
- </Grid>
- <Grid container direction="row"
- justifyContent="space-between"
- alignItems="center">
- <Grid item xs={3} md={3} sx={{ ml: 3, mr: 1, mb: 3, mt: 3 }}>
- <Button
- size="large"
- variant="contained"
- onClick={()=>{navigate('/emailTemplate/-1')}}
- sx={{
- textTransform: 'capitalize',
- alignItems: 'end'
- }}>
- <AddCircleOutlineIcon sx={{ mb: 0.5 }} />
- <Typography sx={{ ml: 1 }} variant="h5">New Email Template</Typography>
- </Button>
- </Grid>
- </Grid>
- </Grid >
- )
- );
- };
-
- export default Index;
|