CEC-2920 Aftersales certificates (#225)
* CEC-2920 aftersales certificates * smells * smells
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import React, { useRef, useState } from "react";
|
||||
import {
|
||||
Button,
|
||||
FormControlLabel,
|
||||
@@ -7,13 +6,15 @@ import {
|
||||
RadioGroup,
|
||||
TextField,
|
||||
} from "@material-ui/core";
|
||||
import React, { useRef, useState } from "react";
|
||||
|
||||
import { CertTypeData, CertTypes } from "../../../utils/certificates";
|
||||
import useStyles from "../../useStyles";
|
||||
import { CertTypes } from "../../Contexts/CertificateContext";
|
||||
|
||||
const getCertTypeLabel = (certtype) => {
|
||||
if (certtype === CertTypes.Aftersales) return "Service Tool ID";
|
||||
return "VIN";
|
||||
const item = CertTypeData.find((item) => certtype === item.value);
|
||||
if (item !== null) return item.inputlabel;
|
||||
return "ID";
|
||||
};
|
||||
|
||||
const CreateForm = ({ onCreate, busy }) => {
|
||||
@@ -60,21 +61,16 @@ const CreateForm = ({ onCreate, busy }) => {
|
||||
onChange={onCertTypeChange}
|
||||
margin="normal"
|
||||
>
|
||||
<FormControlLabel
|
||||
value={CertTypes.TBOX}
|
||||
control={<Radio />}
|
||||
label="TBOX"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value={CertTypes.ICC}
|
||||
control={<Radio />}
|
||||
label="ICC"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value={CertTypes.Charging}
|
||||
control={<Radio />}
|
||||
label="Charging"
|
||||
/>
|
||||
{CertTypeData.map((item, i) => {
|
||||
return (
|
||||
<FormControlLabel
|
||||
key={i}
|
||||
value={item.value}
|
||||
label={item.label}
|
||||
control={<Radio />}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
<Button
|
||||
type="submit"
|
||||
|
||||
Reference in New Issue
Block a user