|
|
@@ -4,8 +4,7 @@ import { |
|
|
|
Grid, |
|
|
|
Typography, |
|
|
|
FormLabel, |
|
|
|
OutlinedInput, |
|
|
|
Button, |
|
|
|
Button, TextField, |
|
|
|
// TextField, |
|
|
|
// Autocomplete, |
|
|
|
} from '@mui/material'; |
|
|
@@ -15,6 +14,8 @@ import * as React from "react"; |
|
|
|
import Loadable from 'components/Loadable'; |
|
|
|
const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); |
|
|
|
import { useForm } from 'react-hook-form'; |
|
|
|
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; |
|
|
|
import {ThemeProvider} from "@emotion/react"; |
|
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
|
const ApplicationDetailCard = ({ |
|
|
|
formData, |
|
|
@@ -35,59 +36,30 @@ const ApplicationDetailCard = ({ |
|
|
|
// initialValues: data, |
|
|
|
// }); |
|
|
|
|
|
|
|
const DisplayField = ({ name, width, value, rows = 1, disabled = false }) => { |
|
|
|
return <OutlinedInput |
|
|
|
const DisplayField = ({ name, rows, value, disabled = false }) => { |
|
|
|
return <TextField |
|
|
|
fullWidth |
|
|
|
multiline |
|
|
|
disabled={disabled} |
|
|
|
size="small" |
|
|
|
// onChange={formik.handleChange} |
|
|
|
inputProps={{ style: {fontSize: '1.1rem'}}} |
|
|
|
InputProps={{ |
|
|
|
style: { |
|
|
|
minHeight:'42.5px', |
|
|
|
maxHeight: '50vh', |
|
|
|
padding: '0 0 0 0', |
|
|
|
height: 'fit-content', |
|
|
|
boxSizing: "inherit"}, |
|
|
|
}} |
|
|
|
sx={{ padding: '10.5px 14px 10.5px 12px'}} |
|
|
|
{...register(name, |
|
|
|
{ |
|
|
|
value: value, |
|
|
|
})} |
|
|
|
id={name} |
|
|
|
name={name} |
|
|
|
variant="outlined" |
|
|
|
multiline |
|
|
|
minRows={rows} |
|
|
|
maxRows={6} |
|
|
|
rows={rows} |
|
|
|
sx={ |
|
|
|
{ |
|
|
|
"& .Mui-disabled": { |
|
|
|
WebkitTextFillColor: "#000000", |
|
|
|
background: "#f8f8f8", |
|
|
|
}, |
|
|
|
// "& .MuiInputBase-input.Mui-disabled": { |
|
|
|
// WebkitTextFillColor: "#000000", |
|
|
|
// background: "#f8f8f8", |
|
|
|
// }, |
|
|
|
width: width ? width : '100%' |
|
|
|
} |
|
|
|
} |
|
|
|
/>; |
|
|
|
} |
|
|
|
|
|
|
|
const { register, handleSubmit } = useForm() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const DisplaySelection = ({ name = "test", value = "", onChange }) => { |
|
|
|
// return <Autocomplete |
|
|
|
// {...register(name)} |
|
|
|
// disablePortal |
|
|
|
// id={name} |
|
|
|
// options={formData} |
|
|
|
// vale={value} |
|
|
|
// onChange={onChange} |
|
|
|
// renderInput={(params) => ( |
|
|
|
// <TextField {...params} |
|
|
|
// InputLabelProps={{ |
|
|
|
// shrink: true |
|
|
|
// }} |
|
|
|
// /> |
|
|
|
// )} |
|
|
|
// /> |
|
|
|
// } |
|
|
|
return ( |
|
|
|
<MainCard |
|
|
|
id={"emailTemplateMainCard"} |
|
|
@@ -141,6 +113,7 @@ const ApplicationDetailCard = ({ |
|
|
|
<DisplayField |
|
|
|
name="description" |
|
|
|
value={formData?.description} |
|
|
|
rows={2} |
|
|
|
/> |
|
|
|
</FormControl> |
|
|
|
</Grid> |
|
|
@@ -168,14 +141,14 @@ const ApplicationDetailCard = ({ |
|
|
|
|
|
|
|
<Grid container direction="row" justifyContent="space-between" |
|
|
|
alignItems="center"> |
|
|
|
<Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> |
|
|
|
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
<Grid item xs={12} md={1.5} lg={1.5} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<FormLabel>Subject (Cht):</FormLabel> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={12} md={9} lg={9}> |
|
|
|
<Grid item xs={12} md={10.5} lg={10.5}> |
|
|
|
<DisplayField |
|
|
|
name="subjectCht" |
|
|
|
value={formData?.subjectCht} |
|
|
@@ -202,18 +175,18 @@ const ApplicationDetailCard = ({ |
|
|
|
</Grid> |
|
|
|
<Grid container direction="row" justifyContent="space-between" |
|
|
|
alignItems="center"> |
|
|
|
<Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> |
|
|
|
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
<Grid item xs={12} md={1.5} lg={1.5} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<FormLabel>Subject (Chs):</FormLabel> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={12} md={9} lg={9}> |
|
|
|
<Grid item xs={12} md={10.5} lg={10.5}> |
|
|
|
<DisplayField |
|
|
|
name="subjectChs" |
|
|
|
value={formData?.subjectChs} |
|
|
|
rows={2} |
|
|
|
rows={1} |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
@@ -236,18 +209,18 @@ const ApplicationDetailCard = ({ |
|
|
|
</Grid> |
|
|
|
<Grid container direction="row" justifyContent="space-between" |
|
|
|
alignItems="center"> |
|
|
|
<Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> |
|
|
|
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
<Grid item xs={12} md={1.5} lg={1.5} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<FormLabel>Subject (Eng):</FormLabel> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={12} md={9} lg={9}> |
|
|
|
<Grid item xs={12} md={10.5} lg={10.5}> |
|
|
|
<DisplayField |
|
|
|
name="subjectEng" |
|
|
|
value={formData?.subjectEng} |
|
|
|
rows={2} |
|
|
|
rows={1} |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
@@ -273,33 +246,25 @@ const ApplicationDetailCard = ({ |
|
|
|
{/*bottom button*/} |
|
|
|
<Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"end"} justifyContent="center"> |
|
|
|
<Grid container maxWidth justifyContent="flex-end"> |
|
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
<Button |
|
|
|
size="large" |
|
|
|
color="error" |
|
|
|
color="delete" |
|
|
|
variant="contained" |
|
|
|
onClick={handleDelete} |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end' |
|
|
|
}} |
|
|
|
> |
|
|
|
<Typography variant="h5">Delete</Typography> |
|
|
|
Delete |
|
|
|
</Button> |
|
|
|
</Grid> |
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
<Button |
|
|
|
size="large" |
|
|
|
variant="contained" |
|
|
|
type="submit" |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end' |
|
|
|
}} |
|
|
|
> |
|
|
|
<Typography variant="h5">Save</Typography> |
|
|
|
Save |
|
|
|
</Button> |
|
|
|
</Grid> |
|
|
|
</ThemeProvider> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|