-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(timesheet): Add TimesheetDetailModal for displaying pending (#3382)
* feat(timesheet): add TimesheetDetailModal for displaying pending timesheet details * fix: coderabbitai
- Loading branch information
1 parent
0ae8dcb
commit 169a2ea
Showing
6 changed files
with
187 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
apps/web/app/[locale]/timesheet/[memberId]/components/TimesheetDetailModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { TimesheetLog, TimesheetStatus } from '@/app/interfaces'; | ||
import { Modal } from '@/lib/components'; | ||
import React from 'react' | ||
import { TimesheetCardDetail } from './TimesheetCard'; | ||
import { useTranslations } from 'next-intl'; | ||
|
||
export interface IAddTaskModalProps { | ||
isOpen: boolean; | ||
closeModal: () => void; | ||
timesheet?: Record<TimesheetStatus, TimesheetLog[]> | ||
} | ||
|
||
function TimesheetDetailModal({ closeModal, isOpen, timesheet }: IAddTaskModalProps) { | ||
const t = useTranslations() | ||
|
||
return ( | ||
<Modal | ||
isOpen={isOpen} | ||
closeModal={closeModal} | ||
title={'View Pending details'} | ||
showCloseIcon | ||
className="bg-light--theme-light dark:bg-dark--theme-light p-5 rounded w-full md:w-40 md:min-w-[35rem]" | ||
titleClass="font-bold flex justify-start w-full text-2xl"> | ||
<div className=' py-4 w-full'> | ||
<div className="flex flex-col w-full gap-4 h-[60vh] max-h-[60vh] overflow-y-auto "> | ||
{ | ||
timesheet?.PENDING.length === 0 ? ( | ||
<div className="grow h-full w-full bg-[#FFFFFF] dark:bg-dark--theme flex flex-col items-center justify-center min-h-[280px]"> | ||
<p>{t('pages.timesheet.NO_ENTRIES_FOUND')}</p> | ||
</div> | ||
) : <TimesheetCardDetail data={timesheet} /> | ||
} | ||
</div> | ||
</div> | ||
|
||
</Modal> | ||
|
||
) | ||
} | ||
|
||
export default TimesheetDetailModal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters