2024-12-03 15:05:13 +00:00
|
|
|
"use client";
|
2024-12-04 14:12:10 +00:00
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { Calendar } from "@/components/ui/calendar";
|
2024-12-03 15:05:13 +00:00
|
|
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
2025-01-16 16:55:04 +00:00
|
|
|
import { Popover, PopoverArrow, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
2024-12-04 14:12:10 +00:00
|
|
|
import { CalendarIcon } from "lucide-react";
|
|
|
|
|
import React, { useEffect, useState } from "react";
|
2024-12-05 14:56:27 +00:00
|
|
|
import { format } from "date-fns";
|
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
|
import { Checkbox } from "@/components/ui/checkbox";
|
2024-12-06 19:15:06 +00:00
|
|
|
import { Icon } from "@iconify/react/dist/iconify.js";
|
2025-01-15 15:59:19 +00:00
|
|
|
import { detailSchedule, listSchedule, listScheduleNextPublic, listSchedulePrevPublic, listScheduleTodayPublic, searchSchedules } from "@/service/schedule/schedule";
|
2025-01-16 16:55:04 +00:00
|
|
|
import { usePathname, useRouter } from "@/i18n/routing";
|
2024-12-16 15:50:19 +00:00
|
|
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog";
|
2024-12-18 16:28:31 +00:00
|
|
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion";
|
2024-12-24 16:16:20 +00:00
|
|
|
import { close, loading } from "@/config/swal";
|
2025-01-13 05:29:14 +00:00
|
|
|
import { useTranslations } from "next-intl";
|
2025-01-15 15:59:19 +00:00
|
|
|
import { Input } from "@/components/ui/input";
|
2024-12-16 15:50:19 +00:00
|
|
|
|
|
|
|
|
const timeList = [
|
|
|
|
|
{
|
|
|
|
|
id: "6",
|
|
|
|
|
time: "06:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "7",
|
|
|
|
|
time: "07:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "8",
|
|
|
|
|
time: "08:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "9",
|
|
|
|
|
time: "09:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "10",
|
|
|
|
|
time: "10:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "11",
|
|
|
|
|
time: "11:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "12",
|
|
|
|
|
time: "12:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "13",
|
|
|
|
|
time: "13:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "14",
|
|
|
|
|
time: "14:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "15",
|
|
|
|
|
time: "15:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "16",
|
|
|
|
|
time: "16:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "17",
|
|
|
|
|
time: "17:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "18",
|
|
|
|
|
time: "18:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "19",
|
|
|
|
|
time: "19:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "20",
|
|
|
|
|
time: "20:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "21",
|
|
|
|
|
time: "21:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "22",
|
|
|
|
|
time: "22:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "23",
|
|
|
|
|
time: "23:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "24",
|
|
|
|
|
time: "24:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "1",
|
|
|
|
|
time: "01:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "2",
|
|
|
|
|
time: "02:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "3",
|
|
|
|
|
time: "03:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "4",
|
|
|
|
|
time: "04:00",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "5",
|
|
|
|
|
time: "05:00",
|
|
|
|
|
},
|
|
|
|
|
];
|
2024-12-03 15:05:13 +00:00
|
|
|
|
2025-01-16 16:55:04 +00:00
|
|
|
const city = [
|
|
|
|
|
{
|
|
|
|
|
key: 1,
|
|
|
|
|
id: "metro-jaya",
|
|
|
|
|
name: "Polda Metro Jaya",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 2,
|
|
|
|
|
id: "jawa-barat",
|
|
|
|
|
name: "Polda Jawa Barat",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 3,
|
|
|
|
|
id: "banten",
|
|
|
|
|
name: "Polda Banten",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 4,
|
|
|
|
|
id: "jawa-tengah",
|
|
|
|
|
name: "Polda Jawa Tengah",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 5,
|
|
|
|
|
id: "daerah-istimewa-yogyakarta",
|
|
|
|
|
name: "Polda D.I Yogyakarta",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 6,
|
|
|
|
|
id: "jawa-timur",
|
|
|
|
|
name: "Polda Jawa Timur",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 7,
|
|
|
|
|
id: "aceh",
|
|
|
|
|
name: "Polda Aceh",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 8,
|
|
|
|
|
id: "sumatera-utara",
|
|
|
|
|
name: "Polda Sumatera Utara",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 9,
|
|
|
|
|
id: "sumatera-barat",
|
|
|
|
|
name: "Polda Sumatera Barat",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2024-12-24 16:16:20 +00:00
|
|
|
const Schedule = (props: any) => {
|
2024-12-16 15:50:19 +00:00
|
|
|
const router = useRouter();
|
2025-01-16 16:55:04 +00:00
|
|
|
const asPath = usePathname();
|
2024-12-05 14:56:27 +00:00
|
|
|
const [startDate, setStartDate] = useState<Date | undefined>(new Date());
|
2024-12-04 14:12:10 +00:00
|
|
|
const [dateAWeek, setDateAWeek] = useState<string[]>([]);
|
2024-12-06 19:15:06 +00:00
|
|
|
const [todayList, setTodayList] = useState([]);
|
2024-12-16 15:50:19 +00:00
|
|
|
const [prevdayList, setPrevdayList] = useState([]);
|
|
|
|
|
const [nextdayList, setNextdayList] = useState([]);
|
|
|
|
|
const [schedules, setSchedules] = useState([]);
|
|
|
|
|
const [openDialog, setOpenDialog] = useState(false);
|
2024-12-24 16:16:20 +00:00
|
|
|
const [detail, setDetail] = useState<any>();
|
|
|
|
|
const [content, setContent] = useState();
|
|
|
|
|
const { id } = props;
|
2025-01-13 05:29:14 +00:00
|
|
|
const t = useTranslations("LandingPage");
|
2025-01-15 15:59:19 +00:00
|
|
|
const [search, setSearch] = useState<any>();
|
|
|
|
|
const [scheduleSearch, setScheduleSearch] = useState<any>();
|
|
|
|
|
let typingTimer: any;
|
|
|
|
|
const doneTypingInterval = 1500;
|
2025-01-16 16:55:04 +00:00
|
|
|
const [regionFilter, setRegionFilter] = useState<any>([]);
|
|
|
|
|
const [regionName, setRegionName] = useState<any>([]);
|
|
|
|
|
const isPolda = asPath.includes("/polda");
|
2025-01-15 15:59:19 +00:00
|
|
|
|
|
|
|
|
async function doneTyping() {
|
|
|
|
|
if (search?.length > 2) {
|
|
|
|
|
const resSchedule = await searchSchedules(search);
|
|
|
|
|
setScheduleSearch(resSchedule.data?.data);
|
|
|
|
|
} else {
|
|
|
|
|
setScheduleSearch([]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleKeyUp = () => {
|
|
|
|
|
clearTimeout(typingTimer);
|
|
|
|
|
typingTimer = setTimeout(doneTyping, doneTypingInterval);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleKeyDown = () => {
|
|
|
|
|
clearTimeout(typingTimer);
|
|
|
|
|
};
|
2024-12-24 16:16:20 +00:00
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
async function getDataSchedule() {
|
|
|
|
|
const response = await detailSchedule(id);
|
2025-01-05 00:44:55 +00:00
|
|
|
setDetail(response?.data?.data);
|
|
|
|
|
setContent(response?.data?.data?.files);
|
2024-12-24 16:16:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDataSchedule();
|
|
|
|
|
}, [id]);
|
2024-12-16 15:50:19 +00:00
|
|
|
|
2025-01-16 16:55:04 +00:00
|
|
|
useEffect(() => {
|
|
|
|
|
async function initState() {
|
|
|
|
|
const group = isPolda ? asPath.split("/")[2] : regionFilter?.join(",");
|
|
|
|
|
const resSchedule = await listSchedule(group);
|
|
|
|
|
setSchedules(resSchedule.data?.data);
|
|
|
|
|
console.log(resSchedule);
|
|
|
|
|
setDateAWeek(dateList);
|
|
|
|
|
getDataByDate(); // let today = new Date();
|
|
|
|
|
// if (!dateList.includes(today.getDate())){
|
|
|
|
|
// changeNextWeek();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initState();
|
|
|
|
|
console.log("Filter ::", regionFilter);
|
|
|
|
|
}, [regionName]);
|
|
|
|
|
|
2024-12-16 15:50:19 +00:00
|
|
|
useEffect(() => {
|
|
|
|
|
async function initState() {
|
|
|
|
|
getDataByDate();
|
|
|
|
|
// const group = isPolda ? asPath.split("/")[2] : regionFilter?.join(",");
|
|
|
|
|
const resSchedule = await listSchedule();
|
|
|
|
|
setSchedules(resSchedule.data?.data);
|
|
|
|
|
console.log(resSchedule);
|
|
|
|
|
setDateAWeek(dateList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initState();
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
async function getDataByDate() {
|
|
|
|
|
const resToday = await listScheduleTodayPublic();
|
|
|
|
|
const today = resToday.data?.data;
|
|
|
|
|
setTodayList(today);
|
|
|
|
|
const resNext = await listScheduleNextPublic();
|
|
|
|
|
const next = resNext.data?.data;
|
|
|
|
|
|
|
|
|
|
setNextdayList(next);
|
|
|
|
|
const resPrev = await listSchedulePrevPublic();
|
|
|
|
|
const prev = resPrev.data?.data;
|
|
|
|
|
|
|
|
|
|
setPrevdayList(prev);
|
|
|
|
|
}
|
2024-12-06 19:15:06 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
const curr = new Date();
|
|
|
|
|
const startDays = (curr.getDay() + 7 - 1) % 7;
|
|
|
|
|
|
|
|
|
|
curr.setDate(curr.getDate() - startDays);
|
|
|
|
|
const dateListInit = [];
|
|
|
|
|
curr.setDate(curr.getDate() - curr.getDay() + 1);
|
|
|
|
|
for (let i = 0; i < 7; i++) {
|
|
|
|
|
dateListInit.push(new Date(curr).toISOString().slice(0, 10));
|
|
|
|
|
curr.setDate(curr.getDate() + 1);
|
|
|
|
|
}
|
|
|
|
|
const [dateList, setDateList] = useState<string[]>(dateListInit);
|
|
|
|
|
|
2024-12-05 14:56:27 +00:00
|
|
|
const handleChangeDate = (date: Date | undefined) => {
|
2024-12-04 14:12:10 +00:00
|
|
|
setStartDate(date);
|
|
|
|
|
const dateListTemp = [];
|
|
|
|
|
const curr = date;
|
2024-12-05 14:56:27 +00:00
|
|
|
if (curr) {
|
2024-12-04 14:12:10 +00:00
|
|
|
const startDays = (curr.getDay() + 7 - 1) % 7;
|
|
|
|
|
|
|
|
|
|
curr.setDate(curr.getDate() - startDays);
|
|
|
|
|
curr.setDate(curr.getDate() - curr.getDay() + 1);
|
|
|
|
|
for (let i = 0; i < 7; i++) {
|
|
|
|
|
dateListTemp.push(new Date(curr).toISOString().slice(0, 10));
|
|
|
|
|
curr.setDate(curr.getDate() + 1);
|
|
|
|
|
}
|
2024-12-05 14:56:27 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
console.log("Change Date :", dateListTemp);
|
|
|
|
|
setDateList(dateListTemp);
|
|
|
|
|
setDateAWeek(dateListTemp);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-05 14:56:27 +00:00
|
|
|
function getLastWeek(today: Date | undefined) {
|
|
|
|
|
if (today) {
|
2024-12-04 14:12:10 +00:00
|
|
|
return new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-05 14:56:27 +00:00
|
|
|
function getNextWeek(today: Date | undefined) {
|
|
|
|
|
if (today) {
|
2024-12-04 14:12:10 +00:00
|
|
|
return new Date(today.getFullYear(), today.getMonth(), today.getDate() + 7);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const changeNextWeek = () => {
|
|
|
|
|
console.log("Today :", startDate);
|
|
|
|
|
const dayInNextWeek = getNextWeek(startDate);
|
|
|
|
|
console.log("Next week :", dayInNextWeek);
|
|
|
|
|
const dateListTemp = [];
|
|
|
|
|
const curr = dayInNextWeek;
|
2024-12-05 14:56:27 +00:00
|
|
|
if (curr) {
|
2024-12-04 14:12:10 +00:00
|
|
|
const startDays = (curr.getDay() + 7 - 1) % 7;
|
|
|
|
|
|
|
|
|
|
curr.setDate(curr.getDate() - startDays);
|
|
|
|
|
curr.setDate(curr.getDate() - curr.getDay() + 1);
|
|
|
|
|
for (let i = 0; i < 7; i++) {
|
|
|
|
|
const newDate = new Date(curr);
|
2024-12-05 14:56:27 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
if (i == 0) {
|
|
|
|
|
setStartDate(newDate);
|
|
|
|
|
}
|
2024-12-05 14:56:27 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
const dateFormatter = Intl.DateTimeFormat("sv-SE");
|
|
|
|
|
dateListTemp.push(dateFormatter.format(newDate));
|
|
|
|
|
curr.setDate(curr.getDate() + 1);
|
|
|
|
|
}
|
2024-12-05 14:56:27 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
console.log(dateListTemp);
|
|
|
|
|
setDateList(dateListTemp);
|
|
|
|
|
setDateAWeek(dateListTemp);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const changePrevWeek = () => {
|
|
|
|
|
console.log(startDate);
|
|
|
|
|
const dayInPrevWeek = getLastWeek(startDate);
|
|
|
|
|
console.log("Prev week :", dayInPrevWeek);
|
|
|
|
|
console.log(startDate);
|
|
|
|
|
const dateListTemp = [];
|
|
|
|
|
const curr = dayInPrevWeek;
|
2024-12-05 14:56:27 +00:00
|
|
|
if (curr) {
|
2024-12-04 14:12:10 +00:00
|
|
|
const startDays = (curr.getDay() + 7 - 1) % 7;
|
|
|
|
|
|
|
|
|
|
curr.setDate(curr.getDate() - startDays);
|
|
|
|
|
curr.setDate(curr.getDate() - curr.getDay() + 1);
|
|
|
|
|
for (let i = 0; i < 7; i++) {
|
|
|
|
|
const newDate = new Date(curr);
|
2024-12-05 14:56:27 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
if (i == 0) {
|
|
|
|
|
setStartDate(newDate);
|
|
|
|
|
}
|
2024-12-05 14:56:27 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
const dateFormatter = Intl.DateTimeFormat("sv-SE");
|
|
|
|
|
dateListTemp.push(dateFormatter.format(newDate));
|
|
|
|
|
curr.setDate(curr.getDate() + 1);
|
|
|
|
|
}
|
2024-12-05 14:56:27 +00:00
|
|
|
|
2024-12-04 14:12:10 +00:00
|
|
|
console.log(dateListTemp);
|
|
|
|
|
setDateList(dateListTemp);
|
|
|
|
|
setDateAWeek(dateListTemp);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-24 16:16:20 +00:00
|
|
|
const getItem = async (itemFound: any) => {
|
|
|
|
|
loading();
|
|
|
|
|
const response = await detailSchedule(itemFound?.id);
|
2025-01-05 00:44:55 +00:00
|
|
|
setDetail(response?.data?.data);
|
|
|
|
|
setContent(response?.data?.data?.files);
|
2024-12-24 16:16:20 +00:00
|
|
|
console.log("item Found", itemFound);
|
|
|
|
|
close();
|
2024-12-16 15:50:19 +00:00
|
|
|
setOpenDialog(true);
|
|
|
|
|
};
|
|
|
|
|
|
2025-01-16 16:55:04 +00:00
|
|
|
const handleRegionFilter = (e: any) => {
|
|
|
|
|
let regions = [...regionFilter];
|
|
|
|
|
|
|
|
|
|
if (e.target.checked) {
|
|
|
|
|
regions = [...regionFilter, e.target.value];
|
|
|
|
|
} else {
|
|
|
|
|
regions.splice(regionFilter.indexOf(e.target.value), 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(regions);
|
|
|
|
|
setRegionFilter(regions);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getListDataCity = () => {
|
|
|
|
|
let filteredReg: any = [];
|
|
|
|
|
let regName = "";
|
|
|
|
|
|
|
|
|
|
for (const element of regionFilter) {
|
|
|
|
|
for (const element_ of city) {
|
|
|
|
|
if (element == element_.id) {
|
|
|
|
|
regName = element_.name;
|
|
|
|
|
filteredReg = [
|
|
|
|
|
...filteredReg,
|
|
|
|
|
{
|
|
|
|
|
id: element_.id,
|
|
|
|
|
key: element_.key,
|
|
|
|
|
name: regName,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(filteredReg);
|
|
|
|
|
setRegionName(filteredReg);
|
|
|
|
|
filteredReg = [];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const doFilter = () => {
|
|
|
|
|
getListDataCity();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const deleteFilterhandler = (filterId: any) => {
|
|
|
|
|
console.log("hapus", filterId);
|
|
|
|
|
const deletedReg = regionName.filter((list: any) => list.id !== filterId);
|
|
|
|
|
const filtered = regionFilter.filter((list: any) => list !== filterId);
|
|
|
|
|
|
|
|
|
|
setRegionName(deletedReg);
|
|
|
|
|
setRegionFilter(filtered);
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-16 15:50:19 +00:00
|
|
|
function setItemSchedule(id: string, date: string) {
|
|
|
|
|
const itemFound: any = schedules?.filter((s: any) => s.dateInRange.includes(date) && s.timeIndex.split(",").includes(id));
|
|
|
|
|
|
|
|
|
|
if (itemFound?.length > 0) {
|
|
|
|
|
if (itemFound?.length == 1) {
|
|
|
|
|
return (
|
|
|
|
|
<a
|
2024-12-17 14:27:48 +00:00
|
|
|
className={`cursor-pointer text-center ${Number(itemFound[0]?.uploaderLevelNumber) == 1 ? "bg-yellow-300" : Number(itemFound[0]?.uploaderLevelNumber) == 2 ? "bg-blue-400" : "bg-gray-500"}`}
|
2024-12-16 15:50:19 +00:00
|
|
|
onClick={() => {
|
|
|
|
|
getItem(itemFound[0]);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<p>
|
|
|
|
|
<b>{itemFound[0]?.title}</b>
|
|
|
|
|
</p>
|
|
|
|
|
{itemFound[0].isYoutube == true ? <p className="live">LIVE</p> : ""}
|
|
|
|
|
{/* <p className="address">{itemFound[0].address}</p> */}
|
|
|
|
|
</a>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// for (let i = 0; i < itemFound.length; i++) {
|
|
|
|
|
// const item = itemFound[i];
|
|
|
|
|
// }
|
|
|
|
|
return (
|
|
|
|
|
<div className="text-left">
|
|
|
|
|
<p>
|
|
|
|
|
<b>{`${itemFound?.length} Jadwal Bersamaan`}</b>
|
|
|
|
|
</p>
|
|
|
|
|
<DropdownMenu>
|
|
|
|
|
<DropdownMenuTrigger className="font-bold text-blue-300">Lihat Jadwal</DropdownMenuTrigger>
|
|
|
|
|
<DropdownMenuContent>
|
|
|
|
|
{itemFound?.map((list: any) => (
|
|
|
|
|
<DropdownMenuItem
|
|
|
|
|
key={list.id}
|
|
|
|
|
className="cursor-pointer"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
getItem(itemFound[0]);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<p>
|
|
|
|
|
<b>{list.title}</b>
|
|
|
|
|
</p>
|
|
|
|
|
{list.isYoutube == true ? <p className="live">LIVE</p> : ""}
|
|
|
|
|
{/* <p className="address">{list.address}</p> */}
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
))}
|
|
|
|
|
</DropdownMenuContent>
|
|
|
|
|
</DropdownMenu>
|
|
|
|
|
<div className="border-0 dropdown-menu schedule-list" aria-labelledby="view-schedule"></div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-04 14:12:10 +00:00
|
|
|
|
2024-12-03 15:05:13 +00:00
|
|
|
return (
|
|
|
|
|
<>
|
2024-12-04 14:12:10 +00:00
|
|
|
{/* Awal Komponen Kiri */}
|
2024-12-20 15:52:53 +00:00
|
|
|
<div className="relative px-4 lg:px-10 lg:py-10 py-4 bg-[#f7f7f7] dark:bg-slate-800">
|
2024-12-04 14:12:10 +00:00
|
|
|
<Popover>
|
|
|
|
|
<PopoverTrigger asChild>
|
2024-12-05 14:56:27 +00:00
|
|
|
<Button variant={"outline"} className={cn("w-[240px] py-4 justify-start text-left font-normal", !startDate && "text-muted-foreground")}>
|
2024-12-04 14:12:10 +00:00
|
|
|
<CalendarIcon />
|
|
|
|
|
{startDate ? format(startDate, "MMM yyyy") : <span>Pick a date</span>}
|
|
|
|
|
</Button>
|
|
|
|
|
</PopoverTrigger>
|
|
|
|
|
<PopoverContent className="w-auto p-0" align="start">
|
2024-12-05 14:56:27 +00:00
|
|
|
<Calendar
|
|
|
|
|
mode="single"
|
|
|
|
|
selected={startDate}
|
|
|
|
|
onSelect={(e) => {
|
|
|
|
|
handleChangeDate(e);
|
|
|
|
|
}}
|
|
|
|
|
initialFocus
|
|
|
|
|
/>
|
2024-12-04 14:12:10 +00:00
|
|
|
</PopoverContent>
|
|
|
|
|
</Popover>
|
|
|
|
|
|
2024-12-06 19:15:06 +00:00
|
|
|
<div className="container relative py-4">
|
2025-01-16 16:55:04 +00:00
|
|
|
<Popover>
|
|
|
|
|
<PopoverTrigger asChild>
|
2025-02-18 02:10:23 +00:00
|
|
|
<a className="text-black dark:text-white flex flex-row w-fit gap-2 py-4 items-center cursor-pointer">
|
2024-12-04 14:12:10 +00:00
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
|
|
|
<path fill="#000" d="M20 3H4a1 1 0 0 0-1 1v2.227l.008.223a3 3 0 0 0 .772 1.795L8 12.886V21a1 1 0 0 0 1.316.949l6-2l.108-.043A1 1 0 0 0 16 19v-6.586l4.121-4.12A3 3 0 0 0 21 6.171V4a1 1 0 0 0-1-1" />
|
|
|
|
|
</svg>
|
|
|
|
|
Filter
|
|
|
|
|
<svg className="flex items-center justify-center" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
|
|
|
<path fill="currentColor" fill-rule="evenodd" d="m6 7l6 6l6-6l2 2l-8 8l-8-8z" />
|
|
|
|
|
</svg>
|
|
|
|
|
</a>
|
2025-01-16 16:55:04 +00:00
|
|
|
</PopoverTrigger>
|
|
|
|
|
<PopoverContent align="start" className="flex p-0 rounded-md w-fit">
|
|
|
|
|
<div className="flex flex-col items-center justify-between gap-1.5 p-2 border-b text-default-600 rounded-none">
|
2024-12-05 14:56:27 +00:00
|
|
|
<div className="gap-6 flex flex-row justify-end">
|
2025-01-16 16:55:04 +00:00
|
|
|
<p className="font-semibold">Filter</p>
|
|
|
|
|
<button className="text-blue-400" onClick={doFilter}>
|
2025-02-03 14:40:26 +00:00
|
|
|
{t("save")}
|
2025-01-16 16:55:04 +00:00
|
|
|
</button>
|
2024-12-05 14:56:27 +00:00
|
|
|
</div>
|
2025-01-16 16:55:04 +00:00
|
|
|
<div className="border w-full border-t border-slate-500"></div>
|
2025-01-24 15:56:24 +00:00
|
|
|
<div className="overflow-y-auto flex flex-col gap-2 h-[200px] ">
|
2025-01-16 16:55:04 +00:00
|
|
|
<p className="text-center font-semibold">Region Filter</p>
|
|
|
|
|
{city?.map((list) => (
|
|
|
|
|
<div className="mt-2 gap-2 flex flex-row">
|
|
|
|
|
{" "}
|
|
|
|
|
<input type="checkbox" className="" id={`filterCategory-${list.key}`} value={list.id} checked={regionFilter?.includes(list.id)} onChange={handleRegionFilter} />
|
|
|
|
|
<p>{list?.name}</p>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
2024-12-04 14:12:10 +00:00
|
|
|
</div>
|
2025-01-16 16:55:04 +00:00
|
|
|
</div>
|
|
|
|
|
</PopoverContent>
|
|
|
|
|
</Popover>
|
2025-01-24 15:56:24 +00:00
|
|
|
<div className="flex flex-col lg:flex-row gap-3">
|
2025-01-16 16:55:04 +00:00
|
|
|
{regionName?.map((list: any) => (
|
2025-01-24 15:56:24 +00:00
|
|
|
<div className="text-left">
|
2025-01-16 16:55:04 +00:00
|
|
|
<button onClick={() => deleteFilterhandler(list.id)} key={list.key} id={list.id} className="text-black bg-yellow-300 w-fit p-3 flex justify-center items-center rounded-lg">
|
|
|
|
|
{list.name}
|
|
|
|
|
<Icon icon="icon-park-outline:delete-two" className="items-center" />
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
2024-12-04 14:12:10 +00:00
|
|
|
</div>
|
2024-12-06 19:15:06 +00:00
|
|
|
<div className="flex flex-col lg:flex-row gap-6">
|
2025-01-24 15:56:24 +00:00
|
|
|
<div className="h-[500px] overflow-y-auto md:overflow-y-auto w-full lg:w-3/4 ">
|
2024-12-06 19:15:06 +00:00
|
|
|
<div className="container-fluid relative">
|
|
|
|
|
<div className="grid grid-cols-1 mt-8">
|
2025-01-24 15:56:24 +00:00
|
|
|
<div className="relative block bg-white w-max dark:bg-slate-900">
|
2024-12-06 19:15:06 +00:00
|
|
|
<table className="w-full text-sm text-start">
|
|
|
|
|
<thead className="text-md">
|
|
|
|
|
<tr className="h-full">
|
2025-02-03 14:40:26 +00:00
|
|
|
<th className="text-center border border-gray-100 dark:border-gray-700 py-6 min-w-[120px]">{t("timeTable")}</th>
|
2024-12-20 15:52:53 +00:00
|
|
|
<th className="text-center border border-r-0 border-gray-100 dark:border-gray-700 py-6 w-[20px]">
|
|
|
|
|
<a onClick={() => changePrevWeek()} className="cursor-pointer h-fit self-center bottom-0">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="40px" height="40px" viewBox="0 0 24 24">
|
|
|
|
|
<path fill="currentColor" d="M12.29 8.71L9.7 11.3a.996.996 0 0 0 0 1.41l2.59 2.59c.63.63 1.71.18 1.71-.71V9.41c0-.89-1.08-1.33-1.71-.7" />
|
|
|
|
|
</svg>
|
|
|
|
|
</a>
|
|
|
|
|
</th>
|
|
|
|
|
<th className={`text-center cursor-pointer border border-l-0 h-full border-gray-100 dark:border-gray-700 py-6 min-w-[100px] ${new Date().toISOString().slice(0, 10) == dateAWeek[0] ? "bg-red-600 text-white" : ""}`}>
|
2024-12-16 15:50:19 +00:00
|
|
|
{/* <a className="cursor-pointer h-fit self-center bottom-0" >
|
2024-12-06 19:15:06 +00:00
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
|
|
|
|
<path fill="currentColor" d="M12.29 8.71L9.7 11.3a.996.996 0 0 0 0 1.41l2.59 2.59c.63.63 1.71.18 1.71-.71V9.41c0-.89-1.08-1.33-1.71-.7" />
|
|
|
|
|
</svg>
|
2024-12-16 15:50:19 +00:00
|
|
|
</a>{" "} */}
|
2024-12-13 14:33:59 +00:00
|
|
|
<div className="flex flex-col ">
|
|
|
|
|
<p className="text-2xl">{dateAWeek[0]?.split("-")[2]}</p>
|
2025-02-03 14:40:26 +00:00
|
|
|
<p>{t("monday")}</p>
|
2024-12-06 19:15:06 +00:00
|
|
|
</div>
|
|
|
|
|
</th>
|
2024-12-13 14:33:59 +00:00
|
|
|
<th className={`text-center border border-gray-100 dark:border-gray-700 py-6 min-w-[100px] ${new Date().toISOString().slice(0, 10) == dateAWeek[1] ? "bg-[#BE0106] text-white rounded-lg" : ""}`}>
|
2025-02-03 14:40:26 +00:00
|
|
|
<div className="text-2xl">{dateAWeek[1]?.split("-")[2]}</div>
|
|
|
|
|
{t("tuesday")}
|
2024-12-06 19:15:06 +00:00
|
|
|
</th>
|
2024-12-13 14:33:59 +00:00
|
|
|
<th className={`text-center border border-gray-100 dark:border-gray-700 py-6 min-w-[100px] ${new Date().toISOString().slice(0, 10) == dateAWeek[2] ? "bg-[#BE0106] text-white rounded-lg" : ""}`}>
|
2025-02-03 14:40:26 +00:00
|
|
|
<div className="text-2xl">{dateAWeek[2]?.split("-")[2]}</div>
|
|
|
|
|
{t("wednesday")}
|
2024-12-06 19:15:06 +00:00
|
|
|
</th>
|
2024-12-13 14:33:59 +00:00
|
|
|
<th className={`text-center border border-gray-100 dark:border-gray-700 py-6 min-w-[100px] ${new Date().toISOString().slice(0, 10) == dateAWeek[3] ? "bg-[#BE0106] text-white rounded-lg" : ""}`}>
|
2025-02-03 14:40:26 +00:00
|
|
|
<div className="text-2xl">{dateAWeek[3]?.split("-")[2]}</div>
|
|
|
|
|
{t("thursday")}
|
2024-12-06 19:15:06 +00:00
|
|
|
</th>
|
2024-12-13 14:33:59 +00:00
|
|
|
<th className={`text-center border border-gray-100 dark:border-gray-700 py-6 min-w-[100px] ${new Date().toISOString().slice(0, 10) == dateAWeek[4] ? "bg-[#BE0106] text-white rounded-lg" : ""}`}>
|
2025-02-03 14:40:26 +00:00
|
|
|
<div className="text-2xl">{dateAWeek[4]?.split("-")[2]}</div>
|
|
|
|
|
{t("friday")}
|
2024-12-06 19:15:06 +00:00
|
|
|
</th>
|
2024-12-13 14:33:59 +00:00
|
|
|
<th className={`text-center border border-gray-100 dark:border-gray-700 py-6 min-w-[100px] ${new Date().toISOString().slice(0, 10) == dateAWeek[5] ? "bg-[#BE0106] text-white rounded-lg" : ""}`}>
|
2025-02-03 14:40:26 +00:00
|
|
|
<div className="text-2xl">{dateAWeek[5]?.split("-")[2]}</div>
|
|
|
|
|
{t("saturday")}
|
2024-12-06 19:15:06 +00:00
|
|
|
</th>
|
2024-12-16 15:50:19 +00:00
|
|
|
<th
|
|
|
|
|
onClick={() => changeNextWeek()}
|
2024-12-20 15:52:53 +00:00
|
|
|
className={`text-center border cursor-pointer border-r-0 border-gray-100 dark:border-gray-700 py-6 min-w-[100px] ${
|
|
|
|
|
new Date().toISOString().slice(0, 10) == dateAWeek[6] ? "bg-[#BE0106] text-white rounded-lg" : ""
|
|
|
|
|
}`}
|
2024-12-16 15:50:19 +00:00
|
|
|
>
|
2024-12-06 19:15:06 +00:00
|
|
|
<div className="flex flex-col ">
|
2024-12-13 14:33:59 +00:00
|
|
|
<p className="text-2xl">{dateAWeek[6]?.split("-")[2]}</p>
|
2025-02-03 14:40:26 +00:00
|
|
|
<p>{t("sunday")}</p>
|
2024-12-06 19:15:06 +00:00
|
|
|
</div>
|
2024-12-16 15:50:19 +00:00
|
|
|
{/* <a className="cursor-pointer h-fit p-0 m-0 self-center">
|
2024-12-06 19:15:06 +00:00
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
|
|
|
|
<path fill="currentColor" d="m11.71 15.29l2.59-2.59a.996.996 0 0 0 0-1.41L11.71 8.7c-.63-.62-1.71-.18-1.71.71v5.17c0 .9 1.08 1.34 1.71.71" />
|
|
|
|
|
</svg>
|
2024-12-16 15:50:19 +00:00
|
|
|
</a> */}
|
2024-12-06 19:15:06 +00:00
|
|
|
</th>
|
2024-12-20 15:52:53 +00:00
|
|
|
<th className="text-center border-l-0 border border-gray-100 dark:border-gray-700 py-6 w-[20px]">
|
|
|
|
|
<a onClick={() => changeNextWeek()} className="cursor-pointer">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="40px" height="40px" viewBox="0 0 24 24">
|
|
|
|
|
<path fill="currentColor" d="m11.71 15.29l2.59-2.59a.996.996 0 0 0 0-1.41L11.71 8.7c-.63-.62-1.71-.18-1.71.71v5.17c0 .9 1.08 1.34 1.71.71" />
|
|
|
|
|
</svg>
|
|
|
|
|
</a>
|
|
|
|
|
</th>
|
2024-12-06 19:15:06 +00:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2024-12-16 15:50:19 +00:00
|
|
|
{timeList.map((times) => (
|
|
|
|
|
<tr key={times.id}>
|
|
|
|
|
<th className="text-center border border-gray-100 dark:border-gray-700 py-5">{times.time}</th>
|
2024-12-20 15:52:53 +00:00
|
|
|
<td colSpan={2} className="p-3 border border-gray-100 dark:border-gray-700 ">
|
|
|
|
|
{setItemSchedule(times.id, dateList[0])}
|
|
|
|
|
</td>
|
2024-12-16 15:50:19 +00:00
|
|
|
<td className="border border-gray-100 dark:border-gray-700">{setItemSchedule(times.id, dateList[1])}</td>
|
|
|
|
|
<td className="border border-gray-100 dark:border-gray-700">{setItemSchedule(times.id, dateList[2])}</td>
|
|
|
|
|
<td className="border border-gray-100 dark:border-gray-700">{setItemSchedule(times.id, dateList[3])}</td>
|
|
|
|
|
<td className="p-3 border border-gray-100 dark:border-gray-700">{setItemSchedule(times.id, dateList[4])}</td>
|
|
|
|
|
<td className="border border-gray-100 dark:border-gray-700">{setItemSchedule(times.id, dateList[5])}</td>
|
2024-12-20 15:52:53 +00:00
|
|
|
<td colSpan={2} className="border border-gray-100 dark:border-gray-700">
|
|
|
|
|
{setItemSchedule(times.id, dateList[6])}
|
|
|
|
|
</td>
|
2024-12-16 15:50:19 +00:00
|
|
|
</tr>
|
|
|
|
|
))}
|
2024-12-06 19:15:06 +00:00
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-12-18 16:28:31 +00:00
|
|
|
|
2025-01-13 05:29:14 +00:00
|
|
|
{/* komponen Kanan */}
|
2025-01-24 15:56:24 +00:00
|
|
|
<div className="w-full lg:w-1/4 flex flex-col gap-6">
|
2024-12-06 19:15:06 +00:00
|
|
|
<div className="relative text-gray-600 dark:text-white">
|
2025-01-15 15:59:19 +00:00
|
|
|
<input
|
|
|
|
|
onChange={(e) => setSearch(e.target.value)}
|
|
|
|
|
onKeyUp={handleKeyUp}
|
|
|
|
|
onKeyDown={handleKeyDown}
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={t("titleSchedule")}
|
|
|
|
|
className="pl-8 pr-4 py-1 w-full border rounded-full text-sm focus:outline-none"
|
|
|
|
|
/>
|
2024-12-06 19:15:06 +00:00
|
|
|
<span className="absolute left-2 top-1/2 transform -translate-y-1/2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
|
|
|
<g fill="none" fill-rule="evenodd">
|
|
|
|
|
<path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z" />
|
|
|
|
|
<path fill="currentColor" d="M10.5 2a8.5 8.5 0 1 0 5.262 15.176l3.652 3.652a1 1 0 0 0 1.414-1.414l-3.652-3.652A8.5 8.5 0 0 0 10.5 2M4 10.5a6.5 6.5 0 1 1 13 0a6.5 6.5 0 0 1-13 0" />
|
|
|
|
|
</g>
|
|
|
|
|
</svg>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2024-12-16 15:50:19 +00:00
|
|
|
|
2024-12-17 14:27:48 +00:00
|
|
|
{/* jadwal hari ini */}
|
2024-12-18 16:28:31 +00:00
|
|
|
{/* <Collapsible className="border border-slate-400 p-2 rounded-lg" open={isOpen} onOpenChange={setIsOpen}>
|
2024-12-17 14:27:48 +00:00
|
|
|
<CollapsibleTrigger>
|
|
|
|
|
<h5 className="py-2 flex justify-between items-center">
|
|
|
|
|
Jadwal Hari Ini
|
|
|
|
|
<span className="flex items-end">
|
|
|
|
|
<Icon icon="fa:angle-down" className="ml-1" />
|
|
|
|
|
</span>
|
|
|
|
|
</h5>
|
|
|
|
|
</CollapsibleTrigger>
|
|
|
|
|
{todayList?.map((list: any) => (
|
|
|
|
|
<CollapsibleContent className={`flex flex-row gap-3 ${isOpen ? "border-b-2 border-black my-3" : ""}`}>
|
|
|
|
|
<div className="border-l-4 border-red-700 pl-1 h-fit font-bold text-lg">{new Date(list.startDate).getDate()}</div>
|
|
|
|
|
<div className="flex flex-col">
|
|
|
|
|
<h3 className="font-bold">{list?.title}</h3>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="iconamoon:clock-thin" />
|
|
|
|
|
{list?.startTime} - {list?.endTime} WIB
|
|
|
|
|
</p>
|
|
|
|
|
<p className="flex flex-row items-start gap-2 ">
|
|
|
|
|
<Icon icon="bxs:map" width={40} />
|
|
|
|
|
{list?.address}
|
|
|
|
|
</p>
|
|
|
|
|
<p>Pembicara :</p>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="ic:round-person" />
|
|
|
|
|
{list?.speakerTitle} {list?.speakerName}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</CollapsibleContent>
|
|
|
|
|
))}
|
2024-12-18 16:28:31 +00:00
|
|
|
</Collapsible> */}
|
2025-01-15 15:59:19 +00:00
|
|
|
|
2024-12-18 16:28:31 +00:00
|
|
|
<Accordion type="single" collapsible className="w-full">
|
|
|
|
|
<AccordionItem value="item-1">
|
2025-02-03 14:40:26 +00:00
|
|
|
<AccordionTrigger>{t("todaySchedule")}</AccordionTrigger>
|
2024-12-23 15:40:32 +00:00
|
|
|
{todayList?.map((list: any) => (
|
2024-12-24 16:33:16 +00:00
|
|
|
<AccordionContent key={list?.id} className="flex flex-row gap-3">
|
2024-12-18 16:28:31 +00:00
|
|
|
<div className="border-l-4 border-red-700 pl-1 h-fit font-bold text-lg">{new Date(list.startDate).getDate()}</div>
|
2024-12-23 15:40:32 +00:00
|
|
|
<div className="flex flex-col gap-2">
|
2024-12-18 16:28:31 +00:00
|
|
|
<h3 className="font-bold">{list?.title}</h3>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="iconamoon:clock-thin" />
|
|
|
|
|
{list?.startTime} - {list?.endTime} WIB
|
|
|
|
|
</p>
|
|
|
|
|
<p className="flex flex-row items-start gap-2 ">
|
|
|
|
|
<Icon icon="bxs:map" width={40} />
|
|
|
|
|
{list?.address}
|
|
|
|
|
</p>
|
2025-02-03 14:40:26 +00:00
|
|
|
<p>{t("speaker")}</p>
|
2024-12-18 16:28:31 +00:00
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="ic:round-person" />
|
|
|
|
|
{list?.speakerTitle} {list?.speakerName}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</AccordionContent>
|
|
|
|
|
))}
|
|
|
|
|
</AccordionItem>
|
|
|
|
|
|
|
|
|
|
<AccordionItem value="item-2">
|
2025-02-03 14:40:26 +00:00
|
|
|
<AccordionTrigger>{t("previousSchedule")}</AccordionTrigger>
|
2024-12-23 15:40:32 +00:00
|
|
|
{prevdayList?.map((list: any) => (
|
2024-12-24 16:33:16 +00:00
|
|
|
<AccordionContent key={list?.id} className="flex flex-row gap-3">
|
2024-12-18 16:28:31 +00:00
|
|
|
<div className="border-l-4 border-red-700 pl-1 h-fit font-bold text-lg">{new Date(list.startDate).getDate()}</div>
|
2024-12-23 15:40:32 +00:00
|
|
|
<div className="flex flex-col gap-2">
|
2024-12-18 16:28:31 +00:00
|
|
|
<h3 className="font-bold">{list?.title}</h3>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="iconamoon:clock-thin" />
|
|
|
|
|
{list?.startTime} - {list?.endTime} WIB
|
|
|
|
|
</p>
|
|
|
|
|
<p className="flex flex-row items-start gap-2 ">
|
|
|
|
|
<Icon icon="bxs:map" width={40} />
|
|
|
|
|
{list?.address}
|
|
|
|
|
</p>
|
2025-02-03 14:40:26 +00:00
|
|
|
<p>{t("speaker")}</p>
|
2024-12-18 16:28:31 +00:00
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="ic:round-person" />
|
|
|
|
|
{list?.speakerTitle} {list?.speakerName}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</AccordionContent>
|
|
|
|
|
))}
|
|
|
|
|
</AccordionItem>
|
|
|
|
|
|
|
|
|
|
<AccordionItem value="item-3">
|
2025-02-03 14:40:26 +00:00
|
|
|
<AccordionTrigger>{t("nextSchedule")}</AccordionTrigger>
|
2024-12-18 16:28:31 +00:00
|
|
|
{nextdayList?.map((list: any) => (
|
2024-12-24 16:33:16 +00:00
|
|
|
<AccordionContent key={list?.id} className="flex flex-row gap-3">
|
2024-12-18 16:28:31 +00:00
|
|
|
<div className="border-l-4 border-red-700 pl-1 h-fit font-bold text-lg">{new Date(list.startDate).getDate()}</div>
|
2024-12-23 15:40:32 +00:00
|
|
|
<div className="flex flex-col gap-2">
|
2024-12-18 16:28:31 +00:00
|
|
|
<h3 className="font-bold">{list?.title}</h3>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="iconamoon:clock-thin" />
|
|
|
|
|
{list?.startTime} - {list?.endTime} WIB
|
|
|
|
|
</p>
|
|
|
|
|
<p className="flex flex-row items-start gap-2 ">
|
|
|
|
|
<Icon icon="bxs:map" width={40} />
|
|
|
|
|
{list?.address}
|
|
|
|
|
</p>
|
2025-02-03 14:40:26 +00:00
|
|
|
<p>{t("speaker")}</p>
|
2024-12-18 16:28:31 +00:00
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="ic:round-person" />
|
|
|
|
|
{list?.speakerTitle} {list?.speakerName}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</AccordionContent>
|
|
|
|
|
))}
|
|
|
|
|
</AccordionItem>
|
|
|
|
|
</Accordion>
|
2024-12-17 14:27:48 +00:00
|
|
|
|
|
|
|
|
{/* jadwal sebelumnya */}
|
2024-12-18 16:28:31 +00:00
|
|
|
{/* <Collapsible className="border border-slate-400 p-2 rounded-lg" open={isOpen} onOpenChange={setIsOpen}>
|
2024-12-16 15:50:19 +00:00
|
|
|
<CollapsibleTrigger>
|
|
|
|
|
<h5 className="py-2 flex justify-between items-center">
|
|
|
|
|
Jadwal Sebelumnya
|
2024-12-17 14:27:48 +00:00
|
|
|
<span className="flex items-end">
|
2024-12-16 15:50:19 +00:00
|
|
|
<Icon icon="fa:angle-down" className="ml-1" />
|
|
|
|
|
</span>
|
|
|
|
|
</h5>
|
|
|
|
|
</CollapsibleTrigger>
|
|
|
|
|
{prevdayList?.map((list: any) => (
|
|
|
|
|
<CollapsibleContent className={`flex flex-row gap-3 ${isOpen ? "border-b-2 border-black my-3" : ""}`}>
|
|
|
|
|
<div className="border-l-4 border-red-700 pl-1 h-fit font-bold text-lg">{new Date(list.startDate).getDate()}</div>
|
|
|
|
|
<div className="flex flex-col">
|
|
|
|
|
<h3 className="font-bold">{list?.title}</h3>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="iconamoon:clock-thin" />
|
|
|
|
|
{list?.startTime} - {list?.endTime} WIB
|
|
|
|
|
</p>
|
|
|
|
|
<p className="flex flex-row items-start gap-2 ">
|
|
|
|
|
<Icon icon="bxs:map" width={40} />
|
|
|
|
|
{list?.address}
|
|
|
|
|
</p>
|
|
|
|
|
<p>Pembicara :</p>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="ic:round-person" />
|
|
|
|
|
{list?.speakerTitle} {list?.speakerName}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</CollapsibleContent>
|
|
|
|
|
))}
|
2024-12-18 16:28:31 +00:00
|
|
|
</Collapsible> */}
|
2024-12-16 15:50:19 +00:00
|
|
|
|
2024-12-17 14:27:48 +00:00
|
|
|
{/* jadwal selanjutnya */}
|
2024-12-18 16:28:31 +00:00
|
|
|
{/* <Collapsible className="border border-slate-400 p-2 rounded-lg" open={isOpen} onOpenChange={setIsOpen}>
|
2024-12-17 14:27:48 +00:00
|
|
|
<CollapsibleTrigger>
|
|
|
|
|
<h5 className="py-2 flex justify-end items-center">
|
|
|
|
|
Jadwal Selanjutnya
|
|
|
|
|
<span className="flex items-end">
|
|
|
|
|
<Icon icon="fa:angle-down" className="ml-1 flex" />
|
|
|
|
|
</span>
|
|
|
|
|
</h5>
|
|
|
|
|
</CollapsibleTrigger>
|
|
|
|
|
{nextdayList?.map((list: any) => (
|
|
|
|
|
<CollapsibleContent className={`flex flex-row gap-3 ${isOpen ? "border-b-2 border-black my-3" : ""}`}>
|
|
|
|
|
<div className="border-l-4 border-red-700 pl-1 h-fit font-bold text-lg">{new Date(list.startDate).getDate()}</div>
|
|
|
|
|
<div className="flex flex-col">
|
|
|
|
|
<h3 className="font-bold">{list?.title}</h3>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="iconamoon:clock-thin" />
|
|
|
|
|
{list?.startTime} - {list?.endTime} WIB
|
|
|
|
|
</p>
|
|
|
|
|
<p className="flex flex-row items-start gap-2 ">
|
|
|
|
|
<Icon icon="bxs:map" width={40} />
|
|
|
|
|
{list?.address}
|
|
|
|
|
</p>
|
|
|
|
|
<p>Pembicara :</p>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="ic:round-person" />
|
|
|
|
|
{list?.speakerTitle} {list?.speakerName}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</CollapsibleContent>
|
|
|
|
|
))}
|
2024-12-18 16:28:31 +00:00
|
|
|
</Collapsible> */}
|
2024-12-03 15:05:13 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-12-06 06:40:43 +00:00
|
|
|
</div>
|
2024-12-17 14:27:48 +00:00
|
|
|
|
2024-12-16 15:50:19 +00:00
|
|
|
<AlertDialog open={openDialog} onOpenChange={setOpenDialog}>
|
|
|
|
|
<AlertDialogContent>
|
|
|
|
|
<AlertDialogHeader>
|
2024-12-24 16:16:20 +00:00
|
|
|
<AlertDialogTitle>
|
|
|
|
|
<h1 className="my-4 font-light">JADWAL / {detail?.isYoutube == true ? "LIVE STREAMING" : "DETAIL"}</h1>
|
|
|
|
|
<p className="font-bold">{detail?.title}</p>
|
|
|
|
|
</AlertDialogTitle>
|
2024-12-17 14:27:48 +00:00
|
|
|
<AlertDialogDescription>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="iconamoon:clock-thin" />
|
2024-12-24 16:16:20 +00:00
|
|
|
{detail?.date} {detail?.startTime} - {detail?.endTime} {detail?.timezone ? detail.timezone : "WIB"}
|
2024-12-17 14:27:48 +00:00
|
|
|
</p>
|
|
|
|
|
</AlertDialogDescription>
|
|
|
|
|
<AlertDialogDescription>
|
|
|
|
|
<p className="flex flex-row items-start gap-2 ">
|
|
|
|
|
<Icon icon="bxs:map" width={30} />
|
2024-12-24 16:16:20 +00:00
|
|
|
{detail?.address}
|
2024-12-17 14:27:48 +00:00
|
|
|
</p>
|
|
|
|
|
</AlertDialogDescription>
|
|
|
|
|
<AlertDialogDescription>
|
|
|
|
|
<p className="flex flex-row items-center gap-2">
|
|
|
|
|
<Icon icon="ic:round-person" />
|
2024-12-24 16:16:20 +00:00
|
|
|
{detail?.speakerTitle || ""} {detail?.speakerName || ""}{" "}
|
2024-12-17 14:27:48 +00:00
|
|
|
</p>
|
|
|
|
|
</AlertDialogDescription>
|
2024-12-16 15:50:19 +00:00
|
|
|
</AlertDialogHeader>
|
|
|
|
|
<AlertDialogFooter>
|
2024-12-24 16:16:20 +00:00
|
|
|
<AlertDialogAction>Close</AlertDialogAction>
|
2024-12-16 15:50:19 +00:00
|
|
|
</AlertDialogFooter>
|
|
|
|
|
</AlertDialogContent>
|
|
|
|
|
</AlertDialog>
|
2024-12-03 15:05:13 +00:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-06 19:15:06 +00:00
|
|
|
export default Schedule;
|