vchikalkin 64dfec1355 refactor(order-form): update service handling to support multiple services
- Renamed `ServiceSelect` to `ServicesSelect` for clarity.
- Updated state management to handle multiple service IDs instead of a single service ID.
- Adjusted related components (`DateSelect`, `TimeSelect`, `SubmitButton`, and `NextButton`) to accommodate the new services structure.
- Removed the deprecated `service-select.tsx` file and refactored related logic in the order store and API to support multiple services.
- Enhanced error handling in the slots service to validate multiple services correctly.
2025-08-19 19:14:14 +03:00

23 lines
630 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client';
import { useOrderStore } from '@/stores/order';
import { Button } from '@repo/ui/components/ui/button';
export function NextButton() {
const { clientId, date, masterId, nextStep, serviceIds, step, time } = useOrderStore(
(store) => store,
);
const isDisabled =
(step === 'master-select' && !masterId) ||
(step === 'client-select' && !clientId) ||
(step === 'service-select' && !serviceIds.length) ||
(step === 'datetime-select' && (!date || !time));
return (
<Button className="w-full" disabled={isDisabled} onClick={nextStep} type="button">
Далее
</Button>
);
}