All files / apps/host/src/components/RequestCardDetailSkeleton/skeletons index.ts

100% Statements 3/3
100% Branches 2/2
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                  4x             4x 9x  
import type { ComponentType } from 'react';
 
import { RequestCategory } from '@/types/request';
 
import { BookRoomSkeleton } from './BookRoomSkeleton';
import { MaintenanceSkeleton } from './MaintenanceSkeleton';
import { ReallocationSkeleton } from './ReallocationSkeleton';
import { TimeOffSkeleton } from './TimeOffSkeleton';
 
export const REQUEST_INFO_SKELETONS: Partial<Record<RequestCategory, ComponentType>> = {
  [RequestCategory.TIME_OFF]: TimeOffSkeleton,
  [RequestCategory.BOOK_ROOM]: BookRoomSkeleton,
  [RequestCategory.REALLOCATION]: ReallocationSkeleton,
  [RequestCategory.MAINTENANCE]: MaintenanceSkeleton,
};
 
export const getRequestInfoSkeleton = (category: RequestCategory): ComponentType =>
  REQUEST_INFO_SKELETONS[category] ?? MaintenanceSkeleton;