track time
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Calendar, Paperclip2, Profile2User, Tag, TickSquare, type Icon } from "iconsax-react";
|
||||
import { Calendar, Paperclip2, Profile2User, Tag, TickSquare, Timer1, type Icon } from "iconsax-react";
|
||||
import { type FC, type ReactNode, useRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import TaskDetailPopoverPanel from "./TaskDetailPopoverPanel";
|
||||
@@ -16,6 +16,7 @@ const TABS: TabItem[] = [
|
||||
{ id: "checklist", icon: TickSquare, labelKey: "taskmanager.task_detail.checklist" },
|
||||
{ id: "attachment", icon: Paperclip2, labelKey: "taskmanager.task_detail.attachment" },
|
||||
{ id: "date", icon: Calendar, labelKey: "taskmanager.task_detail.date_settings" },
|
||||
{ id: "time", icon: Timer1, labelKey: "taskmanager.task_detail.time_tracking" },
|
||||
];
|
||||
|
||||
type Props = {
|
||||
@@ -26,13 +27,14 @@ type Props = {
|
||||
checklistPopover?: ReactNode;
|
||||
attachmentPopover?: ReactNode;
|
||||
datePopover?: ReactNode;
|
||||
timePopover?: ReactNode;
|
||||
};
|
||||
|
||||
const POPOVER_TABS = new Set<TaskDetailTab>(["labels", "users", "checklist", "attachment", "date"]);
|
||||
const POPOVER_TABS = new Set<TaskDetailTab>(["labels", "users", "checklist", "attachment", "date", "time"]);
|
||||
|
||||
type PopoverTab = "labels" | "users" | "checklist" | "attachment" | "date";
|
||||
type PopoverTab = "labels" | "users" | "checklist" | "attachment" | "date" | "time";
|
||||
|
||||
const TaskDetailActionBar: FC<Props> = ({ activeTab, onTabChange, labelsPopover, usersPopover, checklistPopover, attachmentPopover, datePopover }) => {
|
||||
const TaskDetailActionBar: FC<Props> = ({ activeTab, onTabChange, labelsPopover, usersPopover, checklistPopover, attachmentPopover, datePopover, timePopover }) => {
|
||||
const { t } = useTranslation("global");
|
||||
const anchorRefs = useRef<Record<PopoverTab, { current: HTMLElement | null }>>({
|
||||
labels: { current: null },
|
||||
@@ -40,6 +42,7 @@ const TaskDetailActionBar: FC<Props> = ({ activeTab, onTabChange, labelsPopover,
|
||||
checklist: { current: null },
|
||||
attachment: { current: null },
|
||||
date: { current: null },
|
||||
time: { current: null },
|
||||
});
|
||||
|
||||
const popoverByTab: Record<PopoverTab, ReactNode> = {
|
||||
@@ -48,6 +51,7 @@ const TaskDetailActionBar: FC<Props> = ({ activeTab, onTabChange, labelsPopover,
|
||||
checklist: checklistPopover,
|
||||
attachment: attachmentPopover,
|
||||
date: datePopover,
|
||||
time: timePopover,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user