2024-01-24 15:03:54 +00:00
|
|
|
// icons
|
2024-04-08 13:41:47 +00:00
|
|
|
import { AlertTriangle, CheckCircle2, Clock, Copy, LucideIcon, XCircle } from "lucide-react";
|
|
|
|
// types
|
|
|
|
import { TInboxIssueSortingOrderByKeys, TInboxIssueSortingSortByKeys, TInboxIssueStatus } from "@plane/types";
|
2024-01-24 15:03:54 +00:00
|
|
|
// helpers
|
2024-04-08 13:41:47 +00:00
|
|
|
import { findHowManyDaysLeft } from "@/helpers/date-time.helper";
|
2024-01-24 15:03:54 +00:00
|
|
|
|
|
|
|
export const INBOX_STATUS: {
|
|
|
|
key: string;
|
2024-04-08 13:41:47 +00:00
|
|
|
status: TInboxIssueStatus;
|
2024-01-24 15:03:54 +00:00
|
|
|
icon: LucideIcon;
|
|
|
|
title: string;
|
2024-04-08 13:41:47 +00:00
|
|
|
description: (snoozedTillDate: Date) => string;
|
2024-01-24 15:03:54 +00:00
|
|
|
textColor: (snoozeDatePassed: boolean) => string;
|
|
|
|
bgColor: (snoozeDatePassed: boolean) => string;
|
|
|
|
}[] = [
|
|
|
|
{
|
|
|
|
key: "pending",
|
|
|
|
status: -2,
|
|
|
|
icon: AlertTriangle,
|
|
|
|
title: "Pending",
|
2024-04-08 13:41:47 +00:00
|
|
|
description: () => `Pending`,
|
|
|
|
textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-[#AB6400]"),
|
|
|
|
bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-[#FFF7C2]"),
|
2024-01-24 15:03:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "declined",
|
|
|
|
status: -1,
|
|
|
|
icon: XCircle,
|
|
|
|
title: "Declined",
|
2024-04-08 13:41:47 +00:00
|
|
|
description: () => `Declined`,
|
|
|
|
textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-[#CE2C31]"),
|
|
|
|
bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-[#FEEBEC]"),
|
2024-01-24 15:03:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "snoozed",
|
|
|
|
status: 0,
|
|
|
|
icon: Clock,
|
|
|
|
title: "Snoozed",
|
2024-04-08 13:41:47 +00:00
|
|
|
description: (snoozedTillDate: Date = new Date()) => `${findHowManyDaysLeft(snoozedTillDate)} days to go`,
|
|
|
|
textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "text-red-500" : "text-custom-text-400"),
|
|
|
|
bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "bg-red-500/10" : "bg-[#E0E1E6]"),
|
2024-01-24 15:03:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "accepted",
|
|
|
|
status: 1,
|
|
|
|
icon: CheckCircle2,
|
|
|
|
title: "Accepted",
|
2024-04-08 13:41:47 +00:00
|
|
|
description: () => `Accepted`,
|
|
|
|
textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-[#3E9B4F]"),
|
|
|
|
bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-[#E9F6E9]"),
|
2024-01-24 15:03:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "duplicate",
|
|
|
|
status: 2,
|
|
|
|
icon: Copy,
|
|
|
|
title: "Duplicate",
|
2024-04-08 13:41:47 +00:00
|
|
|
description: () => `Duplicate`,
|
2024-01-24 15:03:54 +00:00
|
|
|
textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-custom-text-200"),
|
|
|
|
bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-gray-500/10"),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const INBOX_ISSUE_SOURCE = "in-app";
|
2024-04-08 13:41:47 +00:00
|
|
|
|
|
|
|
export const INBOX_ISSUE_ORDER_BY_OPTIONS: { key: TInboxIssueSortingOrderByKeys; label: string }[] = [
|
|
|
|
{
|
|
|
|
key: "issue__created_at",
|
|
|
|
label: "Date created",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "issue__updated_at",
|
|
|
|
label: "Date updated",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "issue__sequence_id",
|
|
|
|
label: "ID",
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const INBOX_ISSUE_SORT_BY_OPTIONS: { key: TInboxIssueSortingSortByKeys; label: string }[] = [
|
|
|
|
{
|
|
|
|
key: "asc",
|
|
|
|
label: "Ascending",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "desc",
|
|
|
|
label: "Descending",
|
|
|
|
},
|
|
|
|
];
|