From 05c6d7280117a9097feeabc7bd483830b296fff4 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Mon, 17 Feb 2025 17:27:09 +0300 Subject: [PATCH] remove unnecessary context using --- .../schedule/components/slot-card.tsx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/web/components/schedule/components/slot-card.tsx b/apps/web/components/schedule/components/slot-card.tsx index 688537d..24b00dc 100644 --- a/apps/web/components/schedule/components/slot-card.tsx +++ b/apps/web/components/schedule/components/slot-card.tsx @@ -1,10 +1,8 @@ /* eslint-disable canonical/id-match */ 'use client'; -import { ScheduleTimeContextProvider } from '../context'; import { type SlotComponentProps } from '../types'; import { ReadonlyTimeRange } from './time-range'; import { useSlotQuery } from '@/hooks/slots'; -import { withContext } from '@/utils/context'; import { Enum_Slot_State } from '@repo/graphql/types'; import { Badge } from '@repo/ui/components/ui/badge'; import { cn } from '@repo/ui/lib/utils'; @@ -16,15 +14,7 @@ const MAP_BADGE_TEXT: Record = { reserved: 'Зарезервировано', }; -function getBadgeText(state: Enum_Slot_State) { - if (!state) return ''; - - return MAP_BADGE_TEXT[state]; -} - -export const SlotCard = withContext(ScheduleTimeContextProvider)(function ( - props: Readonly, -) { +export function SlotCard(props: Readonly) { const { documentId } = props; const { data } = useSlotQuery({ documentId }); @@ -65,4 +55,10 @@ export const SlotCard = withContext(ScheduleTimeContextProvider)(function ( ); -}); +} + +function getBadgeText(state: Enum_Slot_State) { + if (!state) return ''; + + return MAP_BADGE_TEXT[state]; +}