diff --git a/apps/web/app/[locale]/timesheet/[memberId]/components/AddTaskModal.tsx b/apps/web/app/[locale]/timesheet/[memberId]/components/AddTaskModal.tsx new file mode 100644 index 000000000..b688b20a0 --- /dev/null +++ b/apps/web/app/[locale]/timesheet/[memberId]/components/AddTaskModal.tsx @@ -0,0 +1,156 @@ +import { useTeamTasks } from '@/app/hooks'; +import { ITaskIssue } from '@/app/interfaces'; +import { clsxm } from '@/app/utils'; +import { Modal } from '@/lib/components' +import { CustomSelect, TaskStatus, taskIssues } from '@/lib/features'; +import { Item, ManageOrMemberComponent, getNestedValue } from '@/lib/features/manual-time/manage-member-component'; +import { useTranslations } from 'next-intl'; +import React from 'react' +import { ToggleButton } from './EditTaskModal'; +export interface IAddTaskModalProps { + isOpen: boolean; + closeModal: () => void; +} +export function AddTaskModal({ closeModal, isOpen }: IAddTaskModalProps) { + const t = useTranslations(); + const { activeTeam } = useTeamTasks(); + const [notes, setNotes] = React.useState(''); + const [task, setTasks] = React.useState('') + const [isBillable, setIsBillable] = React.useState(true); + + const projectItemsLists = { + Project: activeTeam?.projects as [], + }; + const handleSelectedValuesChange = (values: { [key: string]: Item | null }) => { + // Handle value changes + }; + const selectedValues = { + Preject: null, + }; + const handleChange = (field: string, selectedItem: Item | null) => { + // Handle field changes + }; + + const fields = [ + { + label: t('sidebar.PROJECTS'), + placeholder: 'Select a project', + isRequired: true, + valueKey: 'id', + displayKey: 'name', + element: 'Project' + }, + ]; + + return ( + +
+
+ + setTasks(e.target?.value)} + className="w-full p-1 border font-normal border-slate-300 dark:border-slate-600 dark:bg-dark--theme-light rounded-md" + required + /> +
+
+ + items)} + renderOption={(option) => ( +
+ + {option} +
+ )} + /> +
+
+ +
+ setIsBillable(true)} + label={t('pages.timesheet.BILLABLE.YES')} + /> + setIsBillable(false)} + label={t('pages.timesheet.BILLABLE.NO')} + /> +
+
+
+ getNestedValue(item, displayKey) || ''} + itemToValue={(item, valueKey) => getNestedValue(item, valueKey) || ''} + /> +
+
+ Notes +