pull main

This commit is contained in:
Sabda Yagra 2025-07-04 12:34:07 +07:00
commit 11eef893f4
1 changed files with 73 additions and 31 deletions

View File

@ -16,7 +16,7 @@ import {
import { CalendarIcon } from "lucide-react"; import { CalendarIcon } from "lucide-react";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { format } from "date-fns"; import { format } from "date-fns";
import { cn } from "@/lib/utils"; import { cn, getCookiesDecrypt } from "@/lib/utils";
import { Checkbox } from "@/components/ui/checkbox"; import { Checkbox } from "@/components/ui/checkbox";
import { Icon } from "@iconify/react/dist/iconify.js"; import { Icon } from "@iconify/react/dist/iconify.js";
import { import {
@ -29,16 +29,13 @@ import {
} from "@/service/schedule/schedule"; } from "@/service/schedule/schedule";
import { usePathname, useRouter } from "@/i18n/routing"; import { usePathname, useRouter } from "@/i18n/routing";
import { import {
AlertDialog, Dialog,
AlertDialogAction, DialogContent,
AlertDialogCancel, DialogDescription,
AlertDialogContent, DialogFooter,
AlertDialogDescription, DialogHeader,
AlertDialogFooter, DialogTitle,
AlertDialogHeader, } from "@/components/ui/dialog";
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { import {
Accordion, Accordion,
AccordionContent, AccordionContent,
@ -217,6 +214,7 @@ const Schedule = (props: any) => {
const [regionFilter, setRegionFilter] = useState<any>([]); const [regionFilter, setRegionFilter] = useState<any>([]);
const [regionName, setRegionName] = useState<any>([]); const [regionName, setRegionName] = useState<any>([]);
const isPolda = asPath.includes("/polda"); const isPolda = asPath.includes("/polda");
const userId = getCookiesDecrypt("uie");
async function doneTyping() { async function doneTyping() {
if (search?.length > 2) { if (search?.length > 2) {
@ -453,6 +451,10 @@ const Schedule = (props: any) => {
getListDataCity(); getListDataCity();
}; };
const goLogin = () => {
router.push("/auth/login");
};
const deleteFilterhandler = (filterId: any) => { const deleteFilterhandler = (filterId: any) => {
console.log("hapus", filterId); console.log("hapus", filterId);
const deletedReg = regionName.filter((list: any) => list.id !== filterId); const deletedReg = regionName.filter((list: any) => list.id !== filterId);
@ -486,7 +488,12 @@ const Schedule = (props: any) => {
<p> <p>
<b>{itemFound[0]?.title}</b> <b>{itemFound[0]?.title}</b>
</p> </p>
{itemFound[0].isYoutube == true ? <p className="live">LIVE</p> : ""} {itemFound[0].isYoutube == true ? (
<div className="flex items-center w-fit gap-1 bg-red-600 text-white px-2 py-1 rounded text-xs font-semibold mx-auto mt-2">
<div className="w-2 h-2 bg-white rounded-full animate-pulse"></div>
<span>LIVE</span>
</div>
) : ""}
{/* <p className="address">{itemFound[0].address}</p> */} {/* <p className="address">{itemFound[0].address}</p> */}
</a> </a>
); );
@ -516,7 +523,12 @@ const Schedule = (props: any) => {
<p> <p>
<b>{list.title}</b> <b>{list.title}</b>
</p> </p>
{list.isYoutube == true ? <p className="live">LIVE</p> : ""} {list.isYoutube == true ? (
<div className="flex items-center w-fit gap-1 bg-red-600 text-white px-2 py-1 rounded text-xs font-semibold mx-auto pt-4">
<div className="w-2 h-2 bg-white rounded-full animate-pulse"></div>
<span>LIVE</span>
</div>
) : ""}
{/* <p className="address">{list.address}</p> */} {/* <p className="address">{list.address}</p> */}
</DropdownMenuItem> </DropdownMenuItem>
))} ))}
@ -1068,41 +1080,71 @@ const Schedule = (props: any) => {
</div> </div>
</div> </div>
<AlertDialog open={openDialog} onOpenChange={setOpenDialog}> <Dialog open={openDialog} onOpenChange={setOpenDialog}>
<AlertDialogContent> <DialogContent size="md">
<AlertDialogHeader> <DialogHeader>
<AlertDialogTitle> <DialogTitle>
<h1 className="my-4 font-light"> <h1 className="my-4 font-light">
{t("timeTable1")} {t("timeTable1")}
{detail?.isYoutube == true ? "LIVE STREAMING" : "DETAIL"} {detail?.isYoutube == true ? "LIVE STREAMING" : "DETAIL"}
</h1> </h1>
<p className="font-bold">{detail?.title}</p> <p className="font-bold">{detail?.title}</p>
</AlertDialogTitle> </DialogTitle>
<AlertDialogDescription> <DialogDescription>
<p className="flex flex-row items-center gap-2"> <p className="flex flex-row items-center gap-2">
<Icon icon="iconamoon:clock-thin" /> <Icon icon="iconamoon:clock-thin" />
{detail?.date} {detail?.startTime} - {detail?.endTime}{" "} {detail?.startDate} {detail?.startTime} - {detail?.endTime}{" "}
{detail?.timezone ? detail.timezone : "WIB"} {detail?.timezone ? detail.timezone : "WIB"}
</p> </p>
</AlertDialogDescription> </DialogDescription>
<AlertDialogDescription> <DialogDescription>
<p className="flex flex-row items-center gap-2 "> <p className="flex flex-row items-center gap-2 ">
<Icon icon="bxs:map" fontSize={20} /> <Icon icon="bxs:map" fontSize={20} />
{detail?.address} {detail?.address}
</p> </p>
</AlertDialogDescription> </DialogDescription>
<AlertDialogDescription> <DialogDescription>
<p className="flex flex-row items-center gap-2"> <p className="flex flex-row items-center gap-2">
<Icon icon="ic:round-person" /> <Icon icon="ic:round-person" />
{detail?.speakerTitle || ""} {detail?.speakerName || ""}{" "} {detail?.speakerTitle || ""} {detail?.speakerName || ""}{" "}
</p> </p>
</AlertDialogDescription> </DialogDescription>
</AlertDialogHeader> <DialogDescription>
<AlertDialogFooter> {detail?.isYoutube == true ? (
<AlertDialogAction>Close</AlertDialogAction> userId == null ? (
</AlertDialogFooter> <div className="login-live-streaming mt-5 text-dark">
</AlertDialogContent> <p className="mb-0">
</AlertDialog> Untuk menonton Live Streaming silahkan
<a className="login" onClick={() => goLogin()}>
{" "}
Login{" "}
</a>
terlebih dahulu
</p>
</div>
) : (
<div className="video-player mt-4">
<iframe
width="100%"
height="480"
src={`${detail?.youtubeEmbedUrl}?autoplay=1&mute=1&enablejsapi=1&origin=${window.location.origin}`}
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowFullScreen
title={detail?.title}
/>
</div>
)
) : (
""
)}
</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button onClick={() => setOpenDialog(false)}>Close</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</> </>
); );
}; };