Skip to content

Commit

Permalink
updated company and admin side view performa
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshatGupta15 committed Jun 16, 2024
1 parent 76d0d66 commit 40cb641
Show file tree
Hide file tree
Showing 2 changed files with 448 additions and 114 deletions.
44 changes: 18 additions & 26 deletions pages/admin/rc/[rcid]/proforma/[proformaid]/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import requestProforma, {
AdminProformaType,
} from "@callbacks/admin/rc/adminproforma";
import eventRequest, { Event } from "@callbacks/admin/rc/proforma/event";
import RichText from "@components/Editor/RichText";

const textFieldColor = "#ff0000";
const textFieldSX = {
Expand All @@ -26,8 +27,11 @@ function View() {
const router = useRouter();
const { rcid } = router.query;
const PID = router.query.proformaid;
const [ctc, setCtc] = useState("");
const [pd, setPd] = useState("");
const rid = (rcid || "").toString();
const ID = (PID || "").toString();
const [isFetched, setisFetched] = useState(false);
const [row, setRow] = useState<AdminProformaType>({
ID: 0,
} as AdminProformaType);
Expand All @@ -39,6 +43,9 @@ function View() {
setRow(response);
let response2 = await eventRequest.getAll(token, rid, ID);
setRow2(response2);
setCtc(response.cost_to_company);
setPd(response.package_details);
setisFetched(true);
}
};
getCompanydata();
Expand Down Expand Up @@ -698,7 +705,7 @@ function View() {
<TextField
multiline
fullWidth
value={row.total_employees}
value={row.total_hires}
InputProps={{
style: { textAlign: "center" },
readOnly: true,
Expand Down Expand Up @@ -776,18 +783,11 @@ function View() {
sx={textFieldSX}
/>
</Grid>
<Grid item xs={12} md={6} key="package_details" padding={0}>
<h4>PPO provision on Performance</h4>
<TextField
multiline
fullWidth
value={row.package_details}
InputProps={{
style: { textAlign: "center" },
readOnly: true,
}}
sx={textFieldSX}
/>
<Grid item xs={12} md={6} key="pd">
<h3>PPO provision on Performance</h3>
{isFetched && (
<RichText onChange={setPd} readOnly value={pd} />
)}
</Grid>
<Grid item xs={12} md={6} key="base" padding={0}>
<h4>Tentative date of confirming of PPOs</h4>
Expand Down Expand Up @@ -815,19 +815,11 @@ function View() {
sx={textFieldSX}
/>
</Grid>
<Grid item xs={12} md={6} key="ctc" padding={0}>
<h4>Tentative CTC for PPO Select</h4>
<TextField
multiline
fullWidth
minRows={4}
value={row.cost_to_company}
InputProps={{
style: { textAlign: "center" },
readOnly: true,
}}
sx={textFieldSX}
/>
<Grid item xs={12} md={6} key="pd">
<h3>Tentative CTC for PPO Selects</h3>
{isFetched && (
<RichText onChange={setCtc} readOnly value={ctc} />
)}
</Grid>
<Grid item xs={12} md={6} key="MedReq">
<h4>Medical Requirements</h4>
Expand Down
Loading

0 comments on commit 40cb641

Please sign in to comment.