All files / src/components/pages/schedule/schedule-list/schedule-list-empty index.tsx

0% Statements 0/32
0% Branches 0/1
0% Functions 0/1
0% Lines 0/32

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                                                                 
import { useRouter } from 'next/navigation';

import { EmptyState } from '@/components/layout/empty-state';
import { Button } from '@/components/ui';

import { EMPTY_STATE_CONFIG, type TabType } from '../constants';

interface Props {
  emptyStateType: TabType;
  emptyStatePath: string;
}

export const ScheduleListEmpty = ({ emptyStateType, emptyStatePath }: Props) => {
  const router = useRouter();
  const config = EMPTY_STATE_CONFIG[emptyStateType];

  const handleEmptyStateClick = () => router.push(emptyStatePath);

  return (
    <div className={`flex-col-center relative min-h-[calc(100vh-156px)] py-8`}>
      <EmptyState>
        <p>{config.text}</p>
        <Button
          className={`bg-mint-500 text-text-sm-bold text-mono-white hover:bg-mint-600 active:bg-mint-700 mt-4.5 h-10 rounded-xl ${config.buttonWidth}`}
          onClick={handleEmptyStateClick}
        >
          {config.buttonText}
        </Button>
      </EmptyState>
    </div>
  );
};