Skip to content

Commit

Permalink
Added Type for draftState
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamprakash123 committed Jan 29, 2024
1 parent 98f91c1 commit a94f47c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Components/ABDM/LinkABHANumberModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,20 @@ interface Props {
onClose: () => void;
}

interface draftState {
currentStep: Step;
transactionId: string;
state: any;
}

type Step =
| "RestoreOptions"
| "ScanExistingQR"
| "AadhaarVerification"
| "MobileVerification"
| "HealthIDCreation";

const initialState = {
const initialState: draftState = {
currentStep: "AadhaarVerification",
transactionId: "",
state: {},
Expand All @@ -61,7 +67,7 @@ export default function LinkABHANumberModal({
onSuccess,
...props
}: Props) {
const [draftState, setDraftState] = useState<any>(initialState);
const [draftState, setDraftState] = useState<draftState>(initialState);
const [currentStep, setCurrentStep] = useState<Step>(
localStorage.getItem(`abha-link-${patientId}`) !== null
? "RestoreOptions"
Expand Down

0 comments on commit a94f47c

Please sign in to comment.