refactor components/schedule

This commit is contained in:
vchikalkin 2025-05-23 17:24:54 +03:00
parent 8bac33ef79
commit 4a4701c20e
12 changed files with 11 additions and 10 deletions

View File

@ -1,7 +1,7 @@
/* eslint-disable canonical/id-match */
'use client';
import { EditableTimeRangeForm } from './components/time-range';
import { EditableTimeRangeForm } from '@/components/shared/time-range';
import { useSlotCreate } from '@/hooks/api/slots';
import { ScheduleStoreProvider, useScheduleStore } from '@/stores/schedule';
import { withContext } from '@/utils/context';

View File

@ -1,7 +1,7 @@
'use client';
import { SlotCard } from './components/slot-card';
import { DaySlotAddForm } from './day-slot-add-form';
import { SlotCard } from './slot-card';
import { LoadingSpinner } from '@/components/common/spinner';
import { DateContext } from '@/context/date';
import { useSlotsQuery } from '@/hooks/api/slots';

View File

@ -1,5 +1,4 @@
export * from './calendar';
export * from './day-slot-add-form';
export * from './day-slots-list';
export * from './slot-buttons';
export * from './slot-datetime';

View File

@ -1,8 +1,8 @@
'use client';
import { SlotDate } from './components/slot-date';
import { SlotTime } from './components/slot-time';
import { type SlotComponentProps } from './types';
import { type SlotComponentProps } from '../types';
import { SlotDate } from './slot-date';
import { SlotTime } from './slot-time';
import { ScheduleStoreProvider } from '@/stores/schedule';
import { withContext } from '@/utils/context';

View File

@ -2,8 +2,7 @@
'use client';
import { type SlotComponentProps } from '../types';
import { EditableTimeRangeForm } from './time-range';
import { ReadonlyTimeRange } from '@/components/shared/time-range';
import { EditableTimeRangeForm, ReadonlyTimeRange } from '@/components/shared/time-range';
import { useSlotMutation, useSlotQuery } from '@/hooks/api/slots';
import { useZustandStore } from '@/stores/schedule';
import { Button } from '@repo/ui/components/ui/button';

View File

@ -1,7 +1,7 @@
'use client';
import { OrderCard } from '../shared/order-card';
import { type SlotComponentProps } from './types';
import { OrderCard } from '@/components/shared/order-card';
import { useSlotQuery } from '@/hooks/api/slots';
export function SlotOrdersList({ documentId }: Readonly<SlotComponentProps>) {

View File

@ -2,7 +2,7 @@
'use client';
import { type OrderClient, type OrderComponentProps } from '../schedule/types';
import { ReadonlyTimeRange } from './time-range';
import { ReadonlyTimeRange } from './time-range/readonly';
import { useOrderQuery } from '@/hooks/api/orders';
import { Enum_Order_State } from '@repo/graphql/types';
import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar';

View File

@ -1,4 +1,5 @@
'use client';
import { useScheduleStore } from '@/stores/schedule';
import { Input } from '@repo/ui/components/ui/input';
import { type FormEvent, type PropsWithChildren } from 'react';

View File

@ -0,0 +1,2 @@
export * from './editable';
export * from './readonly';