w-aura/src/components/palmistry/step-decisions/step-decisions.tsx
Евгений Пономарев 21de1c6322 Palmistry
2024-03-22 00:28:03 +00:00

46 lines
1.1 KiB
TypeScript

import Button from '../button/button';
import useSteps, { DecisionsChoice } from '../../../hooks/palmistry/use-steps';
export default function StepDecisions() {
const steps = useSteps();
const onNext = (choice: DecisionsChoice) => {
steps.saveCurrent(choice);
steps.goNext(choice);
};
return (
<>
<div className="palmistry-container__title-wrapper">
<h3>Do you make decisions with your head or your heart?</h3>
</div>
<div className="palmistry-container__button-wrapper">
<Button
type="button"
active={steps.storedValue === DecisionsChoice.Heart}
onClick={() => onNext(DecisionsChoice.Heart)}
>
Heart
</Button>
<Button
type="button"
active={steps.storedValue === DecisionsChoice.Head}
onClick={() => onNext(DecisionsChoice.Head)}
>
Head
</Button>
<Button
type="button"
active={steps.storedValue === DecisionsChoice.Both}
onClick={() => onNext(DecisionsChoice.Both)}
>
Both
</Button>
</div>
</>
);
}