mediahub-fe/app/[locale]/(protected)/contributor/agenda-setting/data.ts

163 lines
4.2 KiB
TypeScript
Raw Normal View History

import { getAgendaSettingsList } from "@/service/agenda-setting/agenda-setting";
2024-11-27 04:14:10 +00:00
import { faker } from "@faker-js/faker";
import dayjs from "dayjs";
2024-11-27 04:14:10 +00:00
const date = new Date();
const prevDay = new Date().getDate() - 1;
const nextDay = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
const INITIAL_YEAR = dayjs().format("YYYY");
const INITIAL_MONTH = dayjs().format("M");
2024-11-27 04:14:10 +00:00
// prettier-ignore
const nextMonth = date.getMonth() === 11 ? new Date(date.getFullYear() + 1, 0, 1) : new Date(date.getFullYear(), date.getMonth() + 1, 1)
// prettier-ignore
const prevMonth = date.getMonth() === 11 ? new Date(date.getFullYear() - 1, 0, 1) : new Date(date.getFullYear(), date.getMonth() - 1, 1)
export const getCalendarEvents = async () => {
const res = await getAgendaSettingsList(INITIAL_YEAR, INITIAL_MONTH, "");
if (res.error) {
return false;
}
console.log("ress", res.data.data);
return res?.data?.data;
};
2024-11-27 04:14:10 +00:00
export const calendarEvents = [
{
id: faker.string.uuid(),
title: "aaaAll Day Event",
2024-11-27 04:14:10 +00:00
start: date,
end: nextDay,
allDay: false,
//className: "warning",
extendedProps: {
calendar: "polda",
2024-11-27 04:14:10 +00:00
},
},
{
id: faker.string.uuid(),
title: "Meeting With Client",
start: new Date(date.getFullYear(), date.getMonth() + 1, -11),
end: new Date(date.getFullYear(), date.getMonth() + 1, -10),
allDay: true,
//className: "success",
extendedProps: {
calendar: "national",
2024-11-27 04:14:10 +00:00
},
},
{
id: faker.string.uuid(),
title: "Lunch",
allDay: true,
start: new Date(date.getFullYear(), date.getMonth() + 1, -9),
end: new Date(date.getFullYear(), date.getMonth() + 1, -7),
// className: "info",
extendedProps: {
calendar: "polres",
2024-11-27 04:14:10 +00:00
},
},
{
id: faker.string.uuid(),
title: "Birthday Party",
start: new Date(date.getFullYear(), date.getMonth() + 1, -11),
end: new Date(date.getFullYear(), date.getMonth() + 1, -10),
allDay: true,
//className: "primary",
extendedProps: {
calendar: "polres",
2024-11-27 04:14:10 +00:00
},
},
{
id: faker.string.uuid(),
title: "Birthday Party",
start: new Date(date.getFullYear(), date.getMonth() + 1, -13),
end: new Date(date.getFullYear(), date.getMonth() + 1, -12),
allDay: true,
// className: "danger",
extendedProps: {
calendar: "polda",
2024-11-27 04:14:10 +00:00
},
},
{
id: faker.string.uuid(),
title: "Monthly Meeting",
start: nextMonth,
end: nextMonth,
allDay: true,
//className: "primary",
extendedProps: {
calendar: "international",
2024-11-27 04:14:10 +00:00
},
},
];
export const calendarCategories = [
2024-11-27 04:14:10 +00:00
{
label: "Nasional",
value: "national",
2024-11-27 04:14:10 +00:00
activeClass: "ring-primary-500 bg-primary-500",
className: "group-hover:border-blue-500",
},
{
label: "Polda",
value: "polda",
2024-11-27 04:14:10 +00:00
activeClass: "ring-success-500 bg-success-500",
className: " group-hover:border-green-500",
},
{
label: "Polres",
value: "polres",
2024-11-27 04:14:10 +00:00
activeClass: "ring-danger-500 bg-danger-500",
className: " group-hover:border-red-500",
},
2024-12-30 13:43:39 +00:00
{
label: "Satker",
value: "satker",
activeClass: "ring-yellow-500 bg-yellow-500",
className: " group-hover:border-red-500",
},
2024-11-27 04:14:10 +00:00
{
label: "Internasional",
value: "international",
2024-11-27 04:14:10 +00:00
activeClass: "ring-info-500 bg-info-500",
className: " group-hover:border-cyan-500",
},
];
export const categories = [
{
label: "Nasional",
value: "national",
className:
"data-[state=checked]:bg-primary data-[state=checked]:ring-primary",
2024-11-27 04:14:10 +00:00
},
{
label: "Polda",
value: "polda",
2024-11-27 04:14:10 +00:00
className:
"data-[state=checked]:bg-success data-[state=checked]:ring-success",
2024-11-27 04:14:10 +00:00
},
{
label: "Polres",
value: "polres",
className:
"data-[state=checked]:bg-destructive data-[state=checked]:ring-destructive ",
2024-11-27 04:14:10 +00:00
},
2024-12-30 13:43:39 +00:00
{
label: "Satker",
value: "satker",
className:
"data-[state=checked]:bg-warning data-[state=checked]:ring-warning ",
},
2024-11-27 04:14:10 +00:00
{
label: "Internasional",
value: "international",
2024-11-27 04:14:10 +00:00
className: "data-[state=checked]:bg-info data-[state=checked]:ring-info ",
},
];
export type CalendarEvent = (typeof calendarEvents)[number];
export type CalendarCategory = (typeof calendarCategories)[number];
export type Category = (typeof categories)[number];