fix(order-form): hide next button on success & error pages

This commit is contained in:
vchikalkin 2025-08-23 15:51:56 +03:00
parent ad589e471c
commit f9e50972cd

View File

@ -27,13 +27,17 @@ function getStepComponent(step: string) {
return STEP_COMPONENTS[step] ?? null;
}
const BUTTON_COMPONENTS: Record<string, JSX.Element> = {
'': <NextButton />,
const BUTTON_COMPONENTS: Record<string, JSX.Element | null> = {
'client-select': <NextButton />,
'datetime-select': <SubmitButton />,
error: null,
'master-select': <NextButton />,
'service-select': <NextButton />,
success: null,
};
function getButtonComponent(step: string) {
return BUTTON_COMPONENTS[step] ?? <NextButton />;
return BUTTON_COMPONENTS[step];
}
export const OrderForm = withContext(OrderStoreProvider)(function () {