All files / src/components/Calendar/DateRangePickerFeedback DateRangePickerFeedbackSkeleton.tsx

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

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 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59  1x     1x     1x     1x           1x 1x   1x 8x 8x 8x 8x 8x   8x 8x 8x 8x 8x 8x 8x 8x   8x 8x 56x 56x 56x 8x 8x   8x 8x 48x 8x 8x 8x   8x 8x 8x 8x 8x 8x 8x    
// Constants
import { CALENDAR_WEEK_ROWS, CALENDAR_WEEKDAY_COUNT } from '@/constants';
 
// Utils
import { combineClasses } from '@shared/utils';
 
// Components
import { Skeleton } from '@/components/common/Skeleton';
 
// Styles
import './styles/date-range-picker-feedback.css';
 
export interface DateRangePickerFeedbackSkeletonProps {
  className?: string;
}
 
export const DATE_RANGE_PICKER_FEEDBACK_SKELETON_TEST_ID =
  'kitchen-day-calendar-skeleton';
 
export const DateRangePickerFeedbackSkeleton = ({
  className,
}: DateRangePickerFeedbackSkeletonProps) => (
  <div
    data-testid={DATE_RANGE_PICKER_FEEDBACK_SKELETON_TEST_ID}
    className={combineClasses('drp-root', className)}
  >
    <div className="drp-calendar">
      <div className="drp-header">
        <Skeleton className="h-5 w-24" />
        <div className="drp-nav">
          <Skeleton className="size-6 rounded-md" />
          <Skeleton className="size-6 rounded-md" />
        </div>
      </div>
 
      <div className="drp-weekdays">
        {Array.from({ length: CALENDAR_WEEKDAY_COUNT }).map((_, i) => (
          <div key={i} className="flex-1 flex justify-center">
            <Skeleton className="h-3 w-6" />
          </div>
        ))}
      </div>
 
      <div className="flex flex-col gap-1 mt-2">
        {Array.from({ length: CALENDAR_WEEK_ROWS }).map((_, i) => (
          <Skeleton key={i} className="h-7 w-full rounded-full" />
        ))}
      </div>
    </div>
 
    <div className="drp-footer mt-2">
      <div className="drp-footer-actions">
        <Skeleton className="w-28 h-10 rounded-[5px]" />
        <Skeleton className="w-[110px] h-10 rounded-[5px]" />
      </div>
    </div>
  </div>
);