All files / src/components/pages/create-group/modals/date-picker-modal/calendar/calendar-footer index.tsx

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

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                                                             
'use client';

import { useContextDays } from '@rehookify/datepicker';

import type { TimePickerState } from '@/components/pages/create-group/modals/date-picker-modal/calendar';

interface Props {
  currentTab: 'date' | 'time';
  selectedTime: TimePickerState;
}

export const CalendarFooter = ({
  selectedTime: { hours, minutes, meridiem },
  currentTab,
}: Props) => {
  const { selectedDates } = useContextDays();

  return (
    <div className='text-text-md-semibold flex-center mt-5 flex-wrap gap-2.5 text-gray-700'>
      <span>{selectedDates[0].getFullYear()}년</span>
      <span className={currentTab === 'date' ? 'text-mint-600' : ''}>
        {selectedDates[0].getMonth() + 1}월 {selectedDates[0].getDate()}일
      </span>
      <span className={currentTab === 'time' ? 'text-mint-600' : ''}>
        {hours}:{minutes}
      </span>
      <span className='w-6.25'>{meridiem}</span>
    </div>
  );
};