feat: add form communication,form task, table communication,table contest

This commit is contained in:
Anang Yusman 2024-12-06 00:02:06 +07:00
parent f895d1401d
commit 8edaedc9d5
25 changed files with 1723 additions and 188 deletions

View File

@ -0,0 +1,16 @@
import SiteBreadcrumb from "@/components/site-breadcrumb";
import FormInternal from "@/components/form/communication/internal-form";
import FormCollaboration from "@/components/form/communication/collaboration-form";
const CollaborationCreatePage = async () => {
return (
<div>
<SiteBreadcrumb />
<div className="space-y-4">
<FormCollaboration />
</div>
</div>
);
};
export default CollaborationCreatePage;

View File

@ -56,6 +56,7 @@ export type CompanyData = {
import { data } from "./data";
import { Input } from "@/components/ui/input";
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
import { Link } from "@/components/navigation";
export const columns: ColumnDef<CompanyData>[] = [
{
@ -181,10 +182,12 @@ const CollaborationTable = () => {
<div className="flex justify-between items-center py-4 px-5">
<div className="flex flex-row items-center gap-3">
<div>
<Button color="primary" className="text-white">
<UploadIcon />
Kolaborasi Baru
</Button>
<Link href={"/communication/collaboration/create"}>
<Button color="primary" className="text-white">
<UploadIcon />
Kolaborasi Baru
</Button>
</Link>
</div>
<div>
<InputGroup merged>

View File

@ -0,0 +1,15 @@
import SiteBreadcrumb from "@/components/site-breadcrumb";
import FormInternal from "@/components/form/communication/internal-form";
const InternalCreatePage = async () => {
return (
<div>
<SiteBreadcrumb />
<div className="space-y-4">
<FormInternal />
</div>
</div>
);
};
export default InternalCreatePage;

View File

@ -47,16 +47,31 @@ import {
} from "@/components/ui/dropdown-menu";
export type CompanyData = {
no: number;
title: string;
createBy: string;
sendTo: string;
date: string;
commentFromUserName: string;
commentToUserName: string;
createdAt: string;
};
import { data } from "./data";
import { Input } from "@/components/ui/input";
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
import { listTicketingInternal } from "@/service/communication/communication";
import { Link } from "@/components/navigation";
export const columns: ColumnDef<CompanyData>[] = [
{
accessorKey: "no",
header: "No",
cell: ({ row }) => (
<div className="flex items-center gap-5">
<div className="flex-1 text-start">
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
{row.getValue("no")}
</h4>
</div>
</div>
),
},
{
accessorKey: "title",
header: "Pertanyaan",
@ -71,24 +86,28 @@ export const columns: ColumnDef<CompanyData>[] = [
),
},
{
accessorKey: "createBy",
accessorKey: "commentFromUserName",
header: "Pengirim ",
cell: ({ row }) => (
<span className="whitespace-nowrap">{row.getValue("createBy")}</span>
<span className="whitespace-nowrap">
{row.getValue("commentFromUserName")}
</span>
),
},
{
accessorKey: "sendTo",
accessorKey: "commentToUserName",
header: "Penerima",
cell: ({ row }) => (
<span className="whitespace-nowrap">{row.getValue("sendTo")}</span>
<span className="whitespace-nowrap">
{row.getValue("commentToUserName")}
</span>
),
},
{
accessorKey: "date",
accessorKey: "createdAt",
header: "Waktu ",
cell: ({ row }) => (
<span className="whitespace-nowrap">{row.getValue("date")}</span>
<span className="whitespace-nowrap">{row.getValue("createdAt")}</span>
),
},
{
@ -129,6 +148,7 @@ export const columns: ColumnDef<CompanyData>[] = [
];
const InternalTable = () => {
const [internalTable, setInternalTable] = React.useState<CompanyData[]>([]);
const [sorting, setSorting] = React.useState<SortingState>([]);
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
[]
@ -140,9 +160,12 @@ const InternalTable = () => {
pageIndex: 0,
pageSize: 6,
});
const [page, setPage] = React.useState(1);
const [totalPage, setTotalPage] = React.useState(1);
const [limit, setLimit] = React.useState(10);
const table = useReactTable({
data,
data: internalTable,
columns,
onSortingChange: setSorting,
onColumnFiltersChange: setColumnFilters,
@ -162,15 +185,41 @@ const InternalTable = () => {
},
});
React.useEffect(() => {
initState();
}, [page, limit]);
async function initState() {
try {
const res = await listTicketingInternal(page);
const data = res.data.content.map((item: any, index: number) => ({
no: (page - 1) * limit + index + 1,
title: item.title,
commentFromUserName: item.commentFromUserName,
commentToUserName: item.commentToUserName,
createdAt: item.createdAt,
}));
setInternalTable(data);
setTotalPage(res.data.totalPages);
console.log(res?.data?.data);
} catch (error) {
console.error("Error fetching tasks:", error);
}
}
return (
<div className="w-full overflow-x-auto">
<div className="flex justify-between items-center py-4 px-5">
<div className="flex flex-row items-center gap-3">
<div>
<Button color="primary" className="text-white">
<UploadIcon />
Pertanyaan Baru
</Button>
<Link href={"/communication/internal/create"}>
<Button color="primary" className="text-white">
<UploadIcon />
Pertanyaan Baru
</Button>
</Link>
</div>
<div>
<InputGroup merged>

View File

@ -46,20 +46,36 @@ import {
} from "@/components/ui/dropdown-menu";
export type CompanyData = {
code: string;
title: string;
no: number;
hastagCode: string;
theme: string;
duration: string;
targetOutput: string;
targetParticipant: string;
status: string;
targetParticipantTopLevel: string;
isPublishForAll: string;
};
import { data } from "./data";
import { Input } from "@/components/ui/input";
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
import { listTask } from "@/service/task";
import { listContest } from "@/service/contest/contest";
export const columns: ColumnDef<CompanyData>[] = [
{
accessorKey: "code",
accessorKey: "no",
header: "No",
cell: ({ row }) => (
<div className="flex items-center gap-5">
<div className="flex-1 text-start">
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
{row.getValue("no")}
</h4>
</div>
</div>
),
},
{
accessorKey: "hastagCode",
header: "Kode",
cell: ({ row }) => (
<div className="flex items-center gap-5">
@ -68,20 +84,20 @@ export const columns: ColumnDef<CompanyData>[] = [
className="text-sm font-bold
text-default-600 whitespace-nowrap mb-1"
>
{row.getValue("code")}
{row.getValue("hastagCode")}
</h4>
</div>
</div>
),
},
{
accessorKey: "title",
accessorKey: "theme",
header: "Judul",
cell: ({ row }) => (
<div className="flex items-center gap-5">
<div className="flex-1 text-start">
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
{row.getValue("title")}
{row.getValue("theme")}
</h4>
</div>
</div>
@ -96,27 +112,27 @@ export const columns: ColumnDef<CompanyData>[] = [
},
{
accessorKey: "targetOutput",
header: "Tanggal Unggah ",
header: "Target Output ",
cell: ({ row }) => (
<span className="whitespace-nowrap">{row.getValue("targetOutput")}</span>
),
},
{
accessorKey: "targetParticipant",
accessorKey: "targetParticipantTopLevel",
header: "Tag ",
cell: ({ row }) => (
<span className="whitespace-nowrap">
{row.getValue("targetParticipant")}
{row.getValue("targetParticipantTopLevel")}
</span>
),
},
{
accessorKey: "status",
accessorKey: "isPublishForAll",
header: "Status",
cell: ({ row }) => {
return (
<span className="whitespace-nowrap text-blue-600">
{row.getValue("status")}
{row.getValue("isPublishForAll")}
</span>
);
},
@ -159,6 +175,7 @@ export const columns: ColumnDef<CompanyData>[] = [
];
const ContestTable = () => {
const [contestTable, setContestTable] = React.useState<CompanyData[]>([]);
const [sorting, setSorting] = React.useState<SortingState>([]);
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
[]
@ -170,9 +187,12 @@ const ContestTable = () => {
pageIndex: 0,
pageSize: 6,
});
const [page, setPage] = React.useState(1);
const [totalPage, setTotalPage] = React.useState(1);
const [limit, setLimit] = React.useState(10);
const table = useReactTable({
data,
data: contestTable,
columns,
onSortingChange: setSorting,
onColumnFiltersChange: setColumnFilters,
@ -192,6 +212,30 @@ const ContestTable = () => {
},
});
React.useEffect(() => {
initState();
}, [page, limit]);
async function initState() {
try {
const res = await listContest(limit, page);
const data = res.data.data.content.map((item: any, index: number) => ({
no: (page - 1) * limit + index + 1,
hastagCode: item.hastagCode,
theme: item.theme,
targetOutput: item.targetOutput,
targetParticipantTopLevel: item.targetParticipantTopLevel,
duration: item.duration,
isDone: item.isDone,
}));
setContestTable(data);
setTotalPage(res.data.totalPages);
} catch (error) {
console.error("Error fetching tasks:", error);
}
}
return (
<div className="w-full overflow-x-auto">
<div className="flex justify-between items-center py-4 px-5">

View File

@ -47,10 +47,10 @@ import {
import { Input } from "@/components/ui/input";
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
import { Link } from "@/components/navigation";
import { listTask } from "@/service/ppid-categories-services";
import { title } from "process";
import search from "../../app/chat/components/search";
import { format } from "date-fns";
import { listTask } from "@/service/task";
export type CompanyData = {
no: number;
@ -202,7 +202,7 @@ const TaskTable = () => {
});
const [page, setPage] = React.useState(1);
const [totalPage, setTotalPage] = React.useState(1);
const [limit, setLimit] = React.useState(10);
const [limit, setLimit] = React.useState(100);
const [search, setSearch] = React.useState(title);
const table = useReactTable({

View File

@ -22,17 +22,25 @@ const Login = ({ params: { locale } }: { params: { locale: string } }) => {
className="lg:block hidden flex-1 overflow-hidden text-[40px] leading-[48px] text-default-600
relative z-[1] bg-default-50"
>
<div className="max-w-[520px] pt-20 ps-20 ">
<div className="max-w-[520px] pt-16 ps-20 ">
<Link href="/" className="mb-6 inline-block">
<Logo />
<Image
src="/assets/mediahub-logo.png"
alt=""
width={250}
height={250}
className="mb-10 w-full h-full"
/>
</Link>
<h4>
Unlock your Project
<span className="text-default-800 font-bold ms-2">performance</span>
</h4>
</div>
<div className="absolute left-0 2xl:bottom-[-160px] bottom-[-130px] h-full w-full z-[-1]">
<Image src="/images/auth/ils1.svg" alt="" width={300} height={300} className="mb-10 w-full h-full" />
<Image
src="/assets/vector-login.svg"
alt=""
width={300}
height={300}
className="mb-10 w-full h-full"
/>
</div>
</div>
<div className="flex-1 relative">
@ -43,20 +51,30 @@ const Login = ({ params: { locale } }: { params: { locale: string } }) => {
<Logo />
</Link>
</div>
<div className="text-center 2xl:mb-10 mb-4">
<h4 className="font-medium">Sign in</h4>
<div className="text-default-500 text-base">Sign in to your account to start using Dashcode</div>
<div className="text-left 2xl:mb-10 mb-4 mt-10">
<h4 className="font-semibold text-3xl text-left">
Silahkan Masuk Ke akun anda terlebih dahulu
</h4>
<div className="text-default-500 text-base">
Belum punya akun?{" "}
<span className="text-red-500">registrasi</span>
</div>
</div>
<LoginForm />
<div className="relative border-b-[#9AA2AF] border-opacity-[16%] border-b pt-6">
<div className="absolute inline-block bg-default-50 dark:bg-default-100 left-1/2 top-1/2 transform -translate-x-1/2 px-4 min-w-max text-sm text-default-500 font-normal">Or continue with</div>
<div className="absolute inline-block bg-default-50 dark:bg-default-100 left-1/2 top-1/2 transform -translate-x-1/2 px-4 min-w-max text-sm text-default-500 font-normal">
Or continue with
</div>
</div>
<div className="max-w-[242px] mx-auto mt-8 w-full">
<Social locale={locale} />
</div>
<div className="md:max-w-[345px] mx-auto font-normal text-default-500 mt-12 uppercase text-sm">
Dont have an account?{" "}
<Link href="/auth/register" className="text-default-900 font-medium hover:underline">
<Link
href="/auth/register"
className="text-default-900 font-medium hover:underline"
>
Sign up
</Link>
</div>

View File

@ -1,19 +1,17 @@
"use client";
import SearchSection from "@/components/landing-page/SearchSection";
import NewContent from "@/components/landing-page/new-content";
import PopularContent from "@/components/landing-page/popular-content";
import ContentCategory from "@/components/landing-page/content-category";
import Coverage from "@/components/landing-page/coverage";
import Navbar from "@/components/landing-page/navbar";
import Hero from "@/components/landing-page/hero";
import Hero from "@/components/landing-page/Hero";
import Footer from "@/components/landing-page/footer";
const Home = ({ params: { locale } }: { params: { locale: string } }) => {
return (
<>
<Navbar />
<Hero />
<SearchSection />

View File

@ -0,0 +1,296 @@
"use client";
import React, { useEffect, useRef, useState } from "react";
import { useForm, Controller } from "react-hook-form";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
import { Card } from "@/components/ui/card";
import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import Swal from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
import { useRouter } from "next/navigation";
import { Checkbox } from "@/components/ui/checkbox";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import JoditEditor from "jodit-react";
import { type } from "os";
import loading from "@/app/[locale]/(protected)/app/projects/loading";
import { request } from "http";
import { error } from "@/lib/utils";
import { createTask } from "@/service/task";
import { options } from "@fullcalendar/core/preact.js";
import { setOptions } from "leaflet";
import {
getCuratorUser,
getTicketingPriority,
saveTicketing,
saveTicketingInternal,
} from "@/service/communication/communication";
import makeAnimated from "react-select/animated";
import Select from "react-select";
import {
SelectTrigger,
SelectValue,
SelectContent,
SelectItem,
} from "@radix-ui/react-select";
import { SelectGroup } from "@/components/ui/select";
const taskSchema = z.object({
title: z.string().min(1, { message: "Judul diperlukan" }),
naration: z.string().min(2, {
message: "Narasi Penugasan harus lebih dari 2 karakter.",
}),
});
interface Option {
id: string;
label: string;
value: string;
fullname: string;
userLevel: string;
userLevelId: string;
}
export default function FormCollaboration() {
const MySwal = withReactContent(Swal);
const router = useRouter();
const editor = useRef(null);
type TaskSchema = z.infer<typeof taskSchema>;
// State for various form fields
const [taskOutput, setTaskOutput] = useState({
all: false,
video: false,
audio: false,
image: false,
text: false,
});
const [assignmentType, setAssignmentType] = useState("mediahub");
const [assignmentCategory, setAssignmentCategory] = useState("publication");
const [mainType, setMainType] = useState<number>(1); // untuk Tipe Penugasan
const [type, setType] = useState<string>("1");
const [options, setOptions] = useState<Option[]>([]);
const [ticketPriority, setTicketPriority] = useState([]);
const [selectedOption, setSelectedOption] = useState<Option | undefined>(
undefined
);
const animatedComponent = makeAnimated();
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
const [selectedTarget, setSelectedTarget] = useState("");
// Opsi untuk dropdown
const priority = [
{ value: "low", label: "Low" },
{ value: "medium", label: "Medium" },
{ value: "high", label: "High" },
];
const {
control,
handleSubmit,
formState: { errors },
} = useForm<TaskSchema>({
resolver: zodResolver(taskSchema),
});
const handleRadioChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const selectedValue = Number(event.target.value);
setMainType(selectedValue);
setPlatformTypeVisible(selectedValue === 2);
};
useEffect(() => {
getUser();
getTicketPriority();
});
const handleChange = (e: any) => {
const selected = e;
setSelectedOption(selected);
};
const formatOptionLabel = (option: Option) => (
<>
<div className="row">
<div className="col">
{option.value} | {option.fullname}
</div>
</div>
<div className="row">
<div className="col">
<b>{option.userLevel}</b>
</div>
</div>
</>
);
async function getTicketPriority() {
const res = await getTicketingPriority();
if (res.data !== null) {
const rawData = res.data?.data;
setTicketPriority(rawData);
}
}
async function getUser() {
const res = await getCuratorUser();
if (res.data !== null) {
const rawUser = res.data?.data?.content;
console.log("raw user", rawUser);
// Tentukan tipe array sebagai Option[]
const optionArr: Option[] = rawUser.map((option: any) => ({
id: option?.id,
label: option?.username + option?.fullname + option?.userLevel?.name,
value: option?.username,
fullname: option?.fullname,
userLevel: option?.userLevel?.name,
userLevelId: option?.userLevel?.id,
}));
setOptions(optionArr);
}
}
const save = async (data: TaskSchema) => {
const requestData = {
title: data.title,
narration: data.naration,
target: selectedTarget,
sendToId: selectedOption?.id, // This should work now without the error
};
const response = await saveTicketing(requestData);
console.log("Form Data Submitted:", requestData);
console.log("response", response);
MySwal.fire({
title: "Sukses",
text: "Data berhasil disimpan.",
icon: "success",
confirmButtonColor: "#3085d6",
confirmButtonText: "OK",
}).then(() => {
router.push("/en/communication");
});
};
const onSubmit = (data: TaskSchema) => {
MySwal.fire({
title: "Simpan Data",
text: "Apakah Anda yakin ingin menyimpan data ini?",
icon: "warning",
showCancelButton: true,
cancelButtonColor: "#d33",
confirmButtonColor: "#3085d6",
confirmButtonText: "Simpan",
}).then((result) => {
if (result.isConfirmed) {
save(data);
}
});
};
return (
<Card>
<div className="px-6 py-6">
<p className="text-lg font-semibold mb-3">Form Penugasan</p>
<form onSubmit={handleSubmit(onSubmit)}>
<div className="gap-5 mb-5">
{/* Input Title */}
<div className="space-y-2">
<Label>Judul</Label>
<Controller
control={control}
name="title"
render={({ field }) => (
<Input
size="md"
type="text"
value={field.value}
onChange={field.onChange}
placeholder="Enter Title"
/>
)}
/>
{errors.title?.message && (
<p className="text-red-400 text-sm">{errors.title.message}</p>
)}
</div>
<div className="w-full">
<div className="mt-5">
<Label>
Priority<span className="text-red-500">*</span>
</Label>
<Select
id="target-select"
options={priority}
onChange={(selectedOption) =>
setSelectedTarget(selectedOption?.value || "")
}
placeholder="Pilih"
styles={{
control: (base) => ({
...base,
minHeight: "40px", // Ukuran sesuai dengan size="md"
}),
}}
/>
</div>
</div>
<div className="w-full">
<div className="mt-5">
<Label>
Eskalasi Untuk <span className="text-red-500">*</span>
</Label>
<Select
options={options}
className="w-100"
closeMenuOnSelect={false}
components={animatedComponent}
onChange={handleChange}
formatOptionLabel={formatOptionLabel}
isMulti={false}
/>
</div>
</div>
<div className="mt-5">
<Label>Narasi Penugasan</Label>
<Controller
control={control}
name="naration"
render={({ field: { onChange, value } }) => (
<JoditEditor
ref={editor}
value={value}
onChange={onChange}
className="dark:text-black"
/>
)}
/>
{errors.naration?.message && (
<p className="text-red-400 text-sm">
{errors.naration.message}
</p>
)}
</div>
</div>
{/* Submit Button */}
<div className="mt-4">
<Button type="submit" color="primary">
Submit
</Button>
</div>
</form>
</div>
</Card>
);
}

View File

@ -0,0 +1,291 @@
"use client";
import React, { useEffect, useRef, useState } from "react";
import { useForm, Controller } from "react-hook-form";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
import { Card } from "@/components/ui/card";
import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import Swal from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
import { useRouter } from "next/navigation";
import { Checkbox } from "@/components/ui/checkbox";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import JoditEditor from "jodit-react";
import { type } from "os";
import loading from "@/app/[locale]/(protected)/app/projects/loading";
import { request } from "http";
import { error } from "@/lib/utils";
import { createTask } from "@/service/task";
import { options } from "@fullcalendar/core/preact.js";
import { setOptions } from "leaflet";
import {
getCuratorUser,
getTicketingPriority,
saveTicketingInternal,
} from "@/service/communication/communication";
import makeAnimated from "react-select/animated";
import Select from "react-select";
import {
SelectTrigger,
SelectValue,
SelectContent,
SelectItem,
} from "@radix-ui/react-select";
import { SelectGroup } from "@/components/ui/select";
const taskSchema = z.object({
title: z.string().min(1, { message: "Judul diperlukan" }),
naration: z.string().min(2, {
message: "Narasi Penugasan harus lebih dari 2 karakter.",
}),
});
interface Option {
id: string;
label: string;
value: string;
fullname: string;
userLevel: string;
userLevelId: string;
}
export default function FormInternal() {
const MySwal = withReactContent(Swal);
const router = useRouter();
const editor = useRef(null);
type TaskSchema = z.infer<typeof taskSchema>;
// State for various form fields
const [taskOutput, setTaskOutput] = useState({
all: false,
video: false,
audio: false,
image: false,
text: false,
});
const [assignmentType, setAssignmentType] = useState("mediahub");
const [assignmentCategory, setAssignmentCategory] = useState("publication");
const [mainType, setMainType] = useState<number>(1); // untuk Tipe Penugasan
const [type, setType] = useState<string>("1");
const [options, setOptions] = useState<Option[]>([]);
const [ticketPriority, setTicketPriority] = useState([]);
const [selectedOption, setSelectedOption] = useState<Option | undefined>(
undefined
);
const animatedComponent = makeAnimated();
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
const [selectedTarget, setSelectedTarget] = useState("");
// Opsi untuk dropdown
const priority = [
{ value: "low", label: "Low" },
{ value: "medium", label: "Medium" },
{ value: "high", label: "High" },
];
const {
control,
handleSubmit,
formState: { errors },
} = useForm<TaskSchema>({
resolver: zodResolver(taskSchema),
});
const handleRadioChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const selectedValue = Number(event.target.value);
setMainType(selectedValue);
setPlatformTypeVisible(selectedValue === 2);
};
useEffect(() => {
getUser();
getTicketPriority();
});
const handleChange = (e: any) => {
const selected = e;
setSelectedOption(selected);
};
const formatOptionLabel = (option: Option) => (
<>
<div className="row">
<div className="col">
{option.value} | {option.fullname}
</div>
</div>
<div className="row">
<div className="col">
<b>{option.userLevel}</b>
</div>
</div>
</>
);
async function getTicketPriority() {
const res = await getTicketingPriority();
if (res.data !== null) {
const rawData = res.data?.data;
setTicketPriority(rawData);
}
}
async function getUser() {
const res = await getCuratorUser();
if (res.data !== null) {
const rawUser = res.data?.data?.content;
console.log("raw user", rawUser);
// Tentukan tipe array sebagai Option[]
const optionArr: Option[] = rawUser.map((option: any) => ({
id: option?.id,
label: option?.username + option?.fullname + option?.userLevel?.name,
value: option?.username,
fullname: option?.fullname,
userLevel: option?.userLevel?.name,
userLevelId: option?.userLevel?.id,
}));
setOptions(optionArr);
}
}
const save = async (data: TaskSchema) => {
const requestData = {
title: data.title,
narration: data.naration,
target: selectedTarget,
sendToId: selectedOption?.id, // This should work now without the error
};
const response = await saveTicketingInternal(requestData);
console.log("Form Data Submitted:", requestData);
console.log("response", response);
MySwal.fire({
title: "Sukses",
text: "Data berhasil disimpan.",
icon: "success",
confirmButtonColor: "#3085d6",
confirmButtonText: "OK",
}).then(() => {
router.push("/en/communication");
});
};
const onSubmit = (data: TaskSchema) => {
MySwal.fire({
title: "Simpan Data",
text: "Apakah Anda yakin ingin menyimpan data ini?",
icon: "warning",
showCancelButton: true,
cancelButtonColor: "#d33",
confirmButtonColor: "#3085d6",
confirmButtonText: "Simpan",
}).then((result) => {
if (result.isConfirmed) {
save(data);
}
});
};
return (
<Card>
<div className="px-6 py-6">
<p className="text-lg font-semibold mb-3">Form Penugasan</p>
<form onSubmit={handleSubmit(onSubmit)}>
<div className="gap-5 mb-5">
{/* Input Title */}
<div className="space-y-2">
<Label>Judul</Label>
<Controller
control={control}
name="title"
render={({ field }) => (
<Input
size="md"
type="text"
value={field.value}
onChange={field.onChange}
placeholder="Enter Title"
/>
)}
/>
{errors.title?.message && (
<p className="text-red-400 text-sm">{errors.title.message}</p>
)}
</div>
<div className="w-full">
<div className="mt-5">
<Label>Priority</Label>
<Select
id="target-select"
options={priority}
onChange={(selectedOption) =>
setSelectedTarget(selectedOption?.value || "")
}
placeholder="Pilih"
styles={{
control: (base) => ({
...base,
minHeight: "40px", // Ukuran sesuai dengan size="md"
}),
}}
/>
</div>
</div>
<div className="w-full">
<div className="mt-5">
<Label>Ditunjukan Untuk</Label>
<Select
options={options}
className="w-100"
closeMenuOnSelect={false}
components={animatedComponent}
onChange={handleChange}
formatOptionLabel={formatOptionLabel}
isMulti={false}
/>
</div>
</div>
<div className="mt-5">
<Label>Narasi Penugasan</Label>
<Controller
control={control}
name="naration"
render={({ field: { onChange, value } }) => (
<JoditEditor
ref={editor}
value={value}
onChange={onChange}
className="dark:text-black"
/>
)}
/>
{errors.naration?.message && (
<p className="text-red-400 text-sm">
{errors.naration.message}
</p>
)}
</div>
</div>
{/* Submit Button */}
<div className="mt-4">
<Button type="submit" color="primary">
Submit
</Button>
</div>
</form>
</div>
</Card>
);
}

View File

@ -20,6 +20,11 @@ import {
import { Checkbox } from "@/components/ui/checkbox";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import JoditEditor from "jodit-react";
import { type } from "os";
import loading from "@/app/[locale]/(protected)/app/projects/loading";
import { request } from "http";
import { error } from "@/lib/utils";
import { createTask } from "@/service/task";
const taskSchema = z.object({
title: z.string().min(1, { message: "Judul diperlukan" }),
@ -35,7 +40,7 @@ export default function FormTask() {
type TaskSchema = z.infer<typeof taskSchema>;
// State for various form fields
const [output, setOutput] = useState({
const [taskOutput, setTaskOutput] = useState({
all: false,
video: false,
audio: false,
@ -45,8 +50,11 @@ export default function FormTask() {
const [assignmentType, setAssignmentType] = useState("mediahub");
const [assignmentCategory, setAssignmentCategory] = useState("publication");
const [mainType, setMainType] = useState<number>(1); // untuk Tipe Penugasan
const [type, setType] = useState<string>("1");
const [selectedTarget, setSelectedTarget] = useState("all");
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
const [unitSelection, setUnitSelection] = useState({
allUnit: false,
mabes: false,
@ -62,17 +70,40 @@ export default function FormTask() {
resolver: zodResolver(taskSchema),
});
const handleRadioChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const selectedValue = Number(event.target.value);
setMainType(selectedValue);
setPlatformTypeVisible(selectedValue === 2);
};
const save = async (data: TaskSchema) => {
const requestData = {
...data,
output,
assignmentType,
assignmentCategory,
target: selectedTarget,
unitSelection,
assignedToRole: "3",
assignmentMainTypeId: 1,
assignmentPurpose: "1",
assignmentTypeId: type,
fileTypeOutput: taskOutput,
id: null,
narration: data.naration,
platformType: "",
title: data.title,
};
const response = await createTask(requestData);
// if (response.error) {
// error(response.message);
// return false;
// }
console.log("Form Data Submitted:", requestData);
console.log("response", response);
MySwal.fire({
title: "Sukses",
@ -161,13 +192,13 @@ export default function FormTask() {
<div className="mt-5">
<Label>Tipe Penugasan</Label>
<RadioGroup
value={assignmentType}
onValueChange={setAssignmentType}
value={String(mainType)}
onValueChange={(value) => setMainType(Number(value))}
className="flex flex-wrap gap-6"
>
<RadioGroupItem value="mediahub" id="mediahub" />
<RadioGroupItem value="1" id="mediahub" />
<Label htmlFor="mediahub">Mediahub</Label>
<RadioGroupItem value="medsos-mediahub" id="medsos-mediahub" />
<RadioGroupItem value="2" id="medsos-mediahub" />
<Label htmlFor="medsos-mediahub">Medsos Mediahub</Label>
</RadioGroup>
</div>
@ -176,28 +207,35 @@ export default function FormTask() {
<div className="mt-5">
<Label>Jenis Penugasan</Label>
<RadioGroup
value={assignmentCategory}
onValueChange={setAssignmentCategory}
value={type} // State yang dipetakan ke value RadioGroup
onValueChange={(value) => setType(value)} // Mengubah nilai state ketika pilihan berubah
className="flex flex-wrap gap-6"
>
<RadioGroupItem value="publication" id="publication" />
<Label htmlFor="publication">Publikasi</Label>
<RadioGroupItem value="amplification" id="amplification" />
<Label htmlFor="amplification">Amplifikasi</Label>
<RadioGroupItem value="contra" id="contra" />
<Label htmlFor="contra">Kontra</Label>
<div className="flex items-center gap-2">
<RadioGroupItem value="1" id="publication" />
<Label htmlFor="publication">Publikasi</Label>
</div>
<div className="flex items-center gap-2">
<RadioGroupItem value="2" id="amplification" />
<Label htmlFor="amplification">Amplifikasi</Label>
</div>
<div className="flex items-center gap-2">
<RadioGroupItem value="3" id="contra" />
<Label htmlFor="contra">Kontra</Label>
</div>
</RadioGroup>
</div>
<div className="mt-5">
<Label>Output Tugas</Label>
<div className="flex flex-wrap gap-3">
{Object.keys(output).map((key) => (
{Object.keys(taskOutput).map((key) => (
<div className="flex items-center gap-2" key={key}>
<Checkbox
id={key}
checked={output[key as keyof typeof output]}
checked={taskOutput[key as keyof typeof taskOutput]}
onCheckedChange={(value) =>
setOutput({ ...output, [key]: value })
setTaskOutput({ ...taskOutput, [key]: value })
}
/>
<Label htmlFor={key}>

View File

@ -2,7 +2,12 @@
import React, { useState } from "react";
import ThemeSwitcher from "@/components/partials/header/theme-switcher";
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "../ui/dropdown-menu";
import Link from "next/link";
import { FiFile, FiImage, FiMusic, FiYoutube } from "react-icons/fi";
import { useParams, usePathname, useRouter } from "next/navigation";
@ -20,18 +25,41 @@ const Navbar = () => {
<div className="flex items-center justify-between px-4 py-3 md:px-6">
{/* Logo */}
<a href="/" className="flex items-center space-x-2">
<img src="/assets/mediahub-logo.gif" alt="Media Hub Logo" className="w-30 h-20 md:w-60 md:h-24 flex" />
<img
src="/assets/mediahub-logo.gif"
alt="Media Hub Logo"
className="w-30 h-20 md:w-60 md:h-24 flex"
/>
</a>
{/* Mobile Menu Toggle */}
<button className="text-black dark:text-white size-20 h-10 w-10 lg:hidden" onClick={() => setMenuOpen(!menuOpen)}>
<button
className="text-black dark:text-white size-20 h-10 w-10 lg:hidden"
onClick={() => setMenuOpen(!menuOpen)}
>
{menuOpen ? (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="#000" d="m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z" />
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path
fill="#000"
d="m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z"
/>
</svg>
) : (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="#000" d="M4 6a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1m0 6a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1m1 5a1 1 0 1 0 0 2h14a1 1 0 1 0 0-2z" />
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path
fill="#000"
d="M4 6a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1m0 6a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1m1 5a1 1 0 1 0 0 2h14a1 1 0 1 0 0-2z"
/>
</svg>
)}
</button>
@ -41,21 +69,45 @@ const Navbar = () => {
<DropdownMenu>
<DropdownMenuTrigger asChild>
<a className=" dark:text-white text-black flex flex-row justify-center items-center ml-5 cursor-pointer">
<svg className="mx-2 dark:" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
className="mx-2 dark:"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M20 7.5H5C4.6023 7.5004 4.221 7.65856 3.93978 7.93978C3.65856 8.221 3.5004 8.6023 3.5 9V19.5C3.5004 19.8977 3.65856 20.279 3.93978 20.5602C4.221 20.8414 4.6023 20.9996 5 21H20C20.3977 20.9996 20.779 20.8414 21.0602 20.5602C21.3414 20.279 21.4996 19.8977 21.5 19.5V9C21.4996 8.6023 21.3414 8.221 21.0602 7.93978C20.779 7.65856 20.3977 7.5004 20 7.5ZM10.25 17.25V11.25L15.5 14.25L10.25 17.25ZM5 4.5H20V6H5V4.5ZM6.5 1.5H18.5V3H6.5V1.5Z"
fill="currentColor"
/>
</svg>
Konten
<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
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>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="p-0 rounded-md overflow-hidden">
<DropdownMenuContent
align="end"
className="p-0 rounded-md overflow-hidden"
>
<DropdownMenuItem
onClick={() => router.push(generateLocalizedPath("/video/filter", String(locale)))}
onClick={() =>
router.push(
generateLocalizedPath("/video/filter", String(locale))
)
}
className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group"
>
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
@ -64,7 +116,11 @@ const Navbar = () => {
</span>
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => router.push(generateLocalizedPath("/audio/filter", String(locale)))}
onClick={() =>
router.push(
generateLocalizedPath("/audio/filter", String(locale))
)
}
className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group"
>
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
@ -73,7 +129,11 @@ const Navbar = () => {
</span>
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => router.push(generateLocalizedPath("/image/filter", String(locale)))}
onClick={() =>
router.push(
generateLocalizedPath("/image/filter", String(locale))
)
}
className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group"
>
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
@ -82,7 +142,11 @@ const Navbar = () => {
</span>
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => router.push(generateLocalizedPath("/document/filter", String(locale)))}
onClick={() =>
router.push(
generateLocalizedPath("/document/filter", String(locale))
)
}
className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group"
>
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
@ -92,9 +156,19 @@ const Navbar = () => {
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<Link href={generateLocalizedPath("/schedule", String(locale))} className="dark:text-white text-black font-medium flex flex-row items-center justify-center hover:text-gray-800">
<Link
href={generateLocalizedPath("/schedule", String(locale))}
className="dark:text-white text-black font-medium flex flex-row items-center justify-center hover:text-gray-800"
>
<span>
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
className="mr-2"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M19.5 4H18.5V3C18.5 2.4 18.1 2 17.5 2C16.9 2 16.5 2.4 16.5 3V4H8.5V3C8.5 2.4 8.1 2 7.5 2C6.9 2 6.5 2.4 6.5 3V4H5.5C3.8 4 2.5 5.3 2.5 7V8H22.5V7C22.5 5.3 21.2 4 19.5 4ZM2.5 19C2.5 20.7 3.8 22 5.5 22H19.5C21.2 22 22.5 20.7 22.5 19V10H2.5V19ZM17.5 12C18.1 12 18.5 12.4 18.5 13C18.5 13.6 18.1 14 17.5 14C16.9 14 16.5 13.6 16.5 13C16.5 12.4 16.9 12 17.5 12ZM17.5 16C18.1 16 18.5 16.4 18.5 17C18.5 17.6 18.1 18 17.5 18C16.9 18 16.5 17.6 16.5 17C16.5 16.4 16.9 16 17.5 16ZM12.5 12C13.1 12 13.5 12.4 13.5 13C13.5 13.6 13.1 14 12.5 14C11.9 14 11.5 13.6 11.5 13C11.5 12.4 11.9 12 12.5 12ZM12.5 16C13.1 16 13.5 16.4 13.5 17C13.5 17.6 13.1 18 12.5 18C11.9 18 11.5 17.6 11.5 17C11.5 16.4 11.9 16 12.5 16ZM7.5 12C8.1 12 8.5 12.4 8.5 13C8.5 13.6 8.1 14 7.5 14C6.9 14 6.5 13.6 6.5 13C6.5 12.4 6.9 12 7.5 12ZM7.5 16C8.1 16 8.5 16.4 8.5 17C8.5 17.6 8.1 18 7.5 18C6.9 18 6.5 17.6 6.5 17C6.5 16.4 6.9 16 7.5 16Z"
fill="currentColor"
@ -103,9 +177,19 @@ const Navbar = () => {
</span>
Jadwal
</Link>
<Link href={pathname?.includes('/in')?`/indeks`:`${locale}/indeks`} className="dark:text-white text-black flex flex-row items-center justify-center font-medium hover:text-gray-800">
<Link
href={pathname?.includes("/in") ? `/indeks` : `${locale}/indeks`}
className="dark:text-white text-black flex flex-row items-center justify-center font-medium hover:text-gray-800"
>
<span>
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
className="mr-2"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
@ -122,21 +206,37 @@ const Navbar = () => {
</Link>
<div className="flex items-center space-x-1 ">
<a href="https://tvradio.polri.go.id/">
<img src="/assets/polriTv.png" className="w-full h-auto flex-auto" />
<img
src="/assets/polriTv.png"
className="w-full h-auto flex-auto"
/>
</a>
</div>
<select className="bg-transparent dark:text-white text-black border-none focus:outline-none" defaultValue="Indonesia">
<select
className="bg-transparent dark:text-white text-black border-none focus:outline-none"
defaultValue="Indonesia"
>
<option>Indonesia</option>
<option>English</option>
</select>
<ThemeSwitcher />
<div className="relative text-gray-600 dark:text-white">
<input type="text" placeholder="Pencarian" className="pl-8 pr-4 py-1 border rounded-full text-sm focus:outline-none" />
<span className="absolute left-2 top-1/2 transform -translate-y-1/2">🔍</span>
<input
type="text"
placeholder="Pencarian"
className="pl-8 pr-4 py-1 border rounded-full text-sm focus:outline-none"
/>
<span className="absolute left-2 top-1/2 transform -translate-y-1/2">
🔍
</span>
</div>
<div className="flex items-center space-x-2">
<button className="px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700">Masuk</button>
<button className="px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-red-600 hover:text-white">Daftar</button>
<button className="px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700">
Masuk
</button>
<button className="px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-red-600 hover:text-white">
Daftar
</button>
</div>
</div>
</div>
@ -147,19 +247,39 @@ const Navbar = () => {
<DropdownMenu>
<DropdownMenuTrigger asChild>
<a className=" text-white flex flex-row items-center cursor-pointer">
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
className="mr-2"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M20 7.5H5C4.6023 7.5004 4.221 7.65856 3.93978 7.93978C3.65856 8.221 3.5004 8.6023 3.5 9V19.5C3.5004 19.8977 3.65856 20.279 3.93978 20.5602C4.221 20.8414 4.6023 20.9996 5 21H20C20.3977 20.9996 20.779 20.8414 21.0602 20.5602C21.3414 20.279 21.4996 19.8977 21.5 19.5V9C21.4996 8.6023 21.3414 8.221 21.0602 7.93978C20.779 7.65856 20.3977 7.5004 20 7.5ZM10.25 17.25V11.25L15.5 14.25L10.25 17.25ZM5 4.5H20V6H5V4.5ZM6.5 1.5H18.5V3H6.5V1.5Z"
fill="white"
/>
</svg>
Konten
<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
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>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="p-0 rounded-md overflow-hidden">
<DropdownMenuContent
align="end"
className="p-0 rounded-md overflow-hidden"
>
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
<span className="text-default-700c flex flex-row justify-center items-center group-hover:text-primary-foreground">
<FiYoutube className="mr-2" />
@ -186,9 +306,19 @@ const Navbar = () => {
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<Link href="#" className="flex text-white flex-row items-center font-medium hover:text-gray-800">
<Link
href="#"
className="flex text-white flex-row items-center font-medium hover:text-gray-800"
>
<span>
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
className="mr-2"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M19.5 4H18.5V3C18.5 2.4 18.1 2 17.5 2C16.9 2 16.5 2.4 16.5 3V4H8.5V3C8.5 2.4 8.1 2 7.5 2C6.9 2 6.5 2.4 6.5 3V4H5.5C3.8 4 2.5 5.3 2.5 7V8H22.5V7C22.5 5.3 21.2 4 19.5 4ZM2.5 19C2.5 20.7 3.8 22 5.5 22H19.5C21.2 22 22.5 20.7 22.5 19V10H2.5V19ZM17.5 12C18.1 12 18.5 12.4 18.5 13C18.5 13.6 18.1 14 17.5 14C16.9 14 16.5 13.6 16.5 13C16.5 12.4 16.9 12 17.5 12ZM17.5 16C18.1 16 18.5 16.4 18.5 17C18.5 17.6 18.1 18 17.5 18C16.9 18 16.5 17.6 16.5 17C16.5 16.4 16.9 16 17.5 16ZM12.5 12C13.1 12 13.5 12.4 13.5 13C13.5 13.6 13.1 14 12.5 14C11.9 14 11.5 13.6 11.5 13C11.5 12.4 11.9 12 12.5 12ZM12.5 16C13.1 16 13.5 16.4 13.5 17C13.5 17.6 13.1 18 12.5 18C11.9 18 11.5 17.6 11.5 17C11.5 16.4 11.9 16 12.5 16ZM7.5 12C8.1 12 8.5 12.4 8.5 13C8.5 13.6 8.1 14 7.5 14C6.9 14 6.5 13.6 6.5 13C6.5 12.4 6.9 12 7.5 12ZM7.5 16C8.1 16 8.5 16.4 8.5 17C8.5 17.6 8.1 18 7.5 18C6.9 18 6.5 17.6 6.5 17C6.5 16.4 6.9 16 7.5 16Z"
fill="white"
@ -197,9 +327,19 @@ const Navbar = () => {
</span>
Jadwal
</Link>
<Link href="#" className="flex text-white flex-row items-center font-medium hover:text-gray-800">
<Link
href="#"
className="flex text-white flex-row items-center font-medium hover:text-gray-800"
>
<span>
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
className="mr-2"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
@ -216,20 +356,38 @@ const Navbar = () => {
</div>
<div className="flex items-center space-x-1 text-yellow-600 font-medium">
<a href="https://tvradio.polri.go.id/">
<img src="/assets/polriTv.png" className="w-32 h-11 flex items-center" />
<img
src="/assets/polriTv.png"
className="w-32 h-11 flex items-center"
/>
</a>
</div>
<select className="w-full bg-transparent text-black border border-gray-300 py-1 px-2 rounded focus:outline-none" defaultValue="Indonesia">
<select
className="w-full bg-transparent text-black border border-gray-300 py-1 px-2 rounded focus:outline-none"
defaultValue="Indonesia"
>
<option>Indonesia</option>
<option>English</option>
</select>
<div className="relative">
<input type="text" placeholder="Pencarian" className="pl-8 pr-4 py-1 border rounded-full text-sm text-gray-600 focus:outline-none w-full" />
<span className="absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-500">🔍</span>
<input
type="text"
placeholder="Pencarian"
className="pl-8 pr-4 py-1 border rounded-full text-sm text-gray-600 focus:outline-none w-full"
/>
<span className="absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-500">
🔍
</span>
</div>
<div className="flex flex-col space-y-2">
<button className="w-full px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700 md:flex">Masuk</button>
<button className="w-full px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-[#bb3523] md:flex hover:text-white">Daftar</button>
<Link href={"/auth"}>
<button className="w-full px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700 md:flex">
Masuk
</button>
</Link>
<button className="w-full px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-[#bb3523] md:flex hover:text-white">
Daftar
</button>
</div>
</div>
)}

View File

@ -1,30 +1,140 @@
import React, { useState } from "react";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "@/components/ui/carousel";
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { Icon } from "@iconify/react/dist/iconify.js";
import { textEllipsis } from "@/utils/globals";
const dummyImage = [
{ id: 1, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 2, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 3, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 4, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 5, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 6, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 7, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 8, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{ id: 9, thumbnail: "/assets/banner-sample.png", date: "17 MEI 2024", title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", time: "18.00 WIB" },
{
id: 1,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 2,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 3,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 4,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 5,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 6,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 7,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 8,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
{
id: 9,
thumbnail: "/assets/banner-sample.png",
date: "17 MEI 2024",
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
time: "18.00 WIB",
},
];
const dummyDescription = [
{ id: 1, title: "Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait", date: "28 November 2024", time: "11.15 WIB", duration: "00:24:55" },
{ id: 2, title: "Kapolres Lahat Himbau Cipta Kondisi Cooling System Pasca Pemungutan Suara Pilkada 2024", date: "28 November 2024", time: "11.15 WIB", duration: "00:24:55" },
{ id: 3, title: "17 Ton Pupuk Bersubsidi yang Akan Diselewengkan ke Banyuasin Berhasil Digagalkan", date: "28 November 2024", time: "11.15 WIB", duration: "00:24:55" },
{ id: 4, title: "Kapolda Sumsel Apelkan 1471 Personel Persiapan Pengamanan Pengawalan Tahan Pungut dan Hitung Suara", date: "28 November 2024", time: "11.15 WIB", duration: "00:24:55" },
{ id: 5, title: "Polrestabes Palembang Berhasil Mengungkap Kasus Penganiayaan Berat di Ilir Barat II", date: "28 November 2024", time: "11.15 WIB", duration: "00:24:55" },
{ id: 6, title: "Tahapan Pilkada di Sumsel Berlangsung Kondusif", date: "28 November 2024", time: "11.15 WIB", duration: "00:24:55" },
{
id: 1,
title:
"Kapolres Batam Berikan pengarahan pagi kepada para anggota dan staf yang terkait",
date: "28 November 2024",
time: "11.15 WIB",
duration: "00:24:55",
},
{
id: 2,
title:
"Kapolres Lahat Himbau Cipta Kondisi Cooling System Pasca Pemungutan Suara Pilkada 2024",
date: "28 November 2024",
time: "11.15 WIB",
duration: "00:24:55",
},
{
id: 3,
title:
"17 Ton Pupuk Bersubsidi yang Akan Diselewengkan ke Banyuasin Berhasil Digagalkan",
date: "28 November 2024",
time: "11.15 WIB",
duration: "00:24:55",
},
{
id: 4,
title:
"Kapolda Sumsel Apelkan 1471 Personel Persiapan Pengamanan Pengawalan Tahan Pungut dan Hitung Suara",
date: "28 November 2024",
time: "11.15 WIB",
duration: "00:24:55",
},
{
id: 5,
title:
"Polrestabes Palembang Berhasil Mengungkap Kasus Penganiayaan Berat di Ilir Barat II",
date: "28 November 2024",
time: "11.15 WIB",
duration: "00:24:55",
},
{
id: 6,
title: "Tahapan Pilkada di Sumsel Berlangsung Kondusif",
date: "28 November 2024",
time: "11.15 WIB",
duration: "00:24:55",
},
];
const NewContent = () => {
@ -41,16 +151,28 @@ const NewContent = () => {
</h2>
<Tabs value={selectedTab} onValueChange={setSelectedTab}>
<TabsList>
<TabsTrigger value="video" className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary">
<TabsTrigger
value="video"
className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary"
>
Audio Visual
</TabsTrigger>
<TabsTrigger value="audio" className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary">
<TabsTrigger
value="audio"
className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary"
>
Audio
</TabsTrigger>
<TabsTrigger value="image" className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary">
<TabsTrigger
value="image"
className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary"
>
Foto
</TabsTrigger>
<TabsTrigger value="teks" className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary">
<TabsTrigger
value="teks"
className="relative text-sm md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary"
>
Teks
</TabsTrigger>
</TabsList>
@ -61,12 +183,27 @@ const NewContent = () => {
<Carousel>
<CarouselContent>
{dummyImage.map((image) => (
<CarouselItem key={image.id} className="md:basis-1/2 lg:basis-1/3">
<img src={image.thumbnail} className="h-60 object-cover w-full items-center justify-center cursor-pointer" />
<CarouselItem
key={image.id}
className="md:basis-1/2 lg:basis-1/3"
>
<img
src={image.thumbnail}
className="h-60 object-cover w-full items-center justify-center cursor-pointer"
/>
<div className="flex flex-row items-center gap-2">
{image.date} {image.time} | <Icon icon="formkit:eye" width="15" height="15" /> 518{" "}
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">
<path fill="#f00" d="M7.707 10.293a1 1 0 1 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0l3-3a1 1 0 0 0-1.414-1.414L11 11.586V6h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5v5.586zM9 4a1 1 0 0 1 2 0v2H9z" />
{image.date} {image.time} |{" "}
<Icon icon="formkit:eye" width="15" height="15" /> 518{" "}
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 20 20"
>
<path
fill="#f00"
d="M7.707 10.293a1 1 0 1 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0l3-3a1 1 0 0 0-1.414-1.414L11 11.586V6h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5v5.586zM9 4a1 1 0 0 1 2 0v2H9z"
/>
</svg>{" "}
</div>
<div className="font-semibold w-fit">{image.title}</div>
@ -80,11 +217,24 @@ const NewContent = () => {
<Carousel>
<CarouselContent>
{dummyDescription.map((description) => (
<CarouselItem key={description.id} className="md:basis-1/2 lg:basis-1/3">
<CarouselItem
key={description.id}
className="md:basis-1/2 lg:basis-1/3"
>
<div className="flex flex-row gap-6">
<a href="#" key={description.id} className="flex flex-col sm:flex-row items-center bg-white dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full">
<a
href="#"
key={description.id}
className="flex flex-col sm:flex-row items-center bg-white dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full"
>
<div className="flex items-center justify-center bg-red-500 text-white rounded-lg w-16 h-8 lg:h-16">
<svg width="32" height="34" viewBox="0 0 32 34" fill="null" xmlns="http://www.w3.org/2000/svg">
<svg
width="32"
height="34"
viewBox="0 0 32 34"
fill="null"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M23.404 0.452014C23.7033 0.35857 24.0204 0.336816 24.3297 0.388509C24.639 0.440203 24.9318 0.563895 25.1845 0.749599C25.4371 0.935304 25.6426 1.17782 25.7843 1.45756C25.9259 1.73731 25.9998 2.04644 26 2.36001V14.414C25.3462 14.2296 24.6766 14.1064 24 14.046V8.36001L10 12.736V27C10 28.1264 9.6197 29.2197 8.92071 30.1029C8.22172 30.9861 7.24499 31.6075 6.14877 31.8663C5.05255 32.125 3.90107 32.0061 2.88089 31.5287C1.86071 31.0514 1.03159 30.2435 0.52787 29.2361C0.024152 28.2286 -0.124656 27.0806 0.105556 25.9781C0.335768 24.8755 0.931513 23.883 1.79627 23.1613C2.66102 22.4396 3.74413 22.031 4.87009 22.0017C5.99606 21.9724 7.09893 22.3242 8.00001 23V6.73601C7.99982 6.30956 8.13596 5.8942 8.38854 5.55059C8.64112 5.20698 8.99692 4.9531 9.40401 4.82601L23.404 0.452014ZM10 10.64L24 6.26601V2.36001L10 6.73601V10.64ZM5.00001 24C4.20436 24 3.44129 24.3161 2.87869 24.8787C2.31608 25.4413 2.00001 26.2044 2.00001 27C2.00001 27.7957 2.31608 28.5587 2.87869 29.1213C3.44129 29.6839 4.20436 30 5.00001 30C5.79566 30 6.55872 29.6839 7.12133 29.1213C7.68394 28.5587 8.00001 27.7957 8.00001 27C8.00001 26.2044 7.68394 25.4413 7.12133 24.8787C6.55872 24.3161 5.79566 24 5.00001 24ZM32 25C32 27.387 31.0518 29.6761 29.364 31.364C27.6761 33.0518 25.387 34 23 34C20.6131 34 18.3239 33.0518 16.636 31.364C14.9482 29.6761 14 27.387 14 25C14 22.6131 14.9482 20.3239 16.636 18.6361C18.3239 16.9482 20.6131 16 23 16C25.387 16 27.6761 16.9482 29.364 18.6361C31.0518 20.3239 32 22.6131 32 25ZM27.47 24.128L21.482 20.828C21.3298 20.7443 21.1583 20.7016 20.9846 20.7043C20.8108 20.707 20.6408 20.7549 20.4912 20.8433C20.3416 20.9317 20.2176 21.0576 20.1315 21.2086C20.0453 21.3595 20 21.5302 20 21.704V28.304C20 28.4778 20.0453 28.6486 20.1315 28.7995C20.2176 28.9504 20.3416 29.0763 20.4912 29.1647C20.6408 29.2531 20.8108 29.301 20.9846 29.3037C21.1583 29.3064 21.3298 29.2638 21.482 29.18L27.47 25.88C27.6268 25.7937 27.7575 25.6669 27.8486 25.5128C27.9397 25.3587 27.9877 25.183 27.9877 25.004C27.9877 24.825 27.9397 24.6493 27.8486 24.4952C27.7575 24.3412 27.6268 24.2143 27.47 24.128Z"
fill="white"
@ -94,9 +244,13 @@ const NewContent = () => {
<div className="flex flex-col flex-1">
<div className="text-gray-500 dark:text-gray-400 flex flex-row text-sm">
{description.date} | <Icon icon="formkit:eye" width="15" height="15" /> 518
{description.date} |{" "}
<Icon icon="formkit:eye" width="15" height="15" />{" "}
518
</div>
<div className="font-semibold text-gray-900 dark:text-white mt-1 text-sm">
{textEllipsis(description.title, 50)}
</div>
<div className="font-semibold text-gray-900 dark:text-white mt-1 text-sm">{textEllipsis(description.title, 50)}</div>
</div>
</a>
</div>
@ -110,12 +264,27 @@ const NewContent = () => {
<Carousel>
<CarouselContent>
{dummyImage.map((image) => (
<CarouselItem key={image.id} className="md:basis-1/2 lg:basis-1/3">
<img src={image.thumbnail} className="h-60 object-cover w-full items-center justify-center cursor-pointer" />
<CarouselItem
key={image.id}
className="md:basis-1/2 lg:basis-1/3"
>
<img
src={image.thumbnail}
className="h-60 object-cover w-full items-center justify-center cursor-pointer"
/>
<div className="flex flex-row items-center gap-2">
{image.date} {image.time} | <Icon icon="formkit:eye" width="15" height="15" /> 518{" "}
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">
<path fill="#f00" d="M7.707 10.293a1 1 0 1 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0l3-3a1 1 0 0 0-1.414-1.414L11 11.586V6h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5v5.586zM9 4a1 1 0 0 1 2 0v2H9z" />
{image.date} {image.time} |{" "}
<Icon icon="formkit:eye" width="15" height="15" /> 518{" "}
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 20 20"
>
<path
fill="#f00"
d="M7.707 10.293a1 1 0 1 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0l3-3a1 1 0 0 0-1.414-1.414L11 11.586V6h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5v5.586zM9 4a1 1 0 0 1 2 0v2H9z"
/>
</svg>{" "}
</div>
<div className="font-semibold w-fit">{image.title}</div>
@ -129,11 +298,23 @@ const NewContent = () => {
<Carousel>
<CarouselContent>
{dummyImage.map((description) => (
<CarouselItem key={description.id} className="md:basis-1/2 lg:basis-1/3">
<CarouselItem
key={description.id}
className="md:basis-1/2 lg:basis-1/3"
>
<div className="md:basis-1/2 lg:basis-1/3">
<a href="#" className="flex flex-col bg-yellow-500 sm:flex-row items-center dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full">
<a
href="#"
className="flex flex-col bg-yellow-500 sm:flex-row items-center dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full"
>
<div className="flex items-center justify-center rounded-lg w-16 h-2 lg:h-16">
<svg width="28" height="34" viewBox="0 0 28 34" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
width="28"
height="34"
viewBox="0 0 28 34"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.6665 17.4167C5.6665 17.0851 5.7982 16.7672 6.03262 16.5328C6.26704 16.2984 6.58498 16.1667 6.9165 16.1667C7.24802 16.1667 7.56597 16.2984 7.80039 16.5328C8.03481 16.7672 8.1665 17.0851 8.1665 17.4167C8.1665 17.7482 8.03481 18.0661 7.80039 18.3005C7.56597 18.535 7.24802 18.6667 6.9165 18.6667C6.58498 18.6667 6.26704 18.535 6.03262 18.3005C5.7982 18.0661 5.6665 17.7482 5.6665 17.4167ZM6.9165 21.1667C6.58498 21.1667 6.26704 21.2984 6.03262 21.5328C5.7982 21.7672 5.6665 22.0851 5.6665 22.4167C5.6665 22.7482 5.7982 23.0661 6.03262 23.3005C6.26704 23.535 6.58498 23.6667 6.9165 23.6667C7.24802 23.6667 7.56597 23.535 7.80039 23.3005C8.03481 23.0661 8.1665 22.7482 8.1665 22.4167C8.1665 22.0851 8.03481 21.7672 7.80039 21.5328C7.56597 21.2984 7.24802 21.1667 6.9165 21.1667ZM5.6665 27.4167C5.6665 27.0851 5.7982 26.7672 6.03262 26.5328C6.26704 26.2984 6.58498 26.1667 6.9165 26.1667C7.24802 26.1667 7.56597 26.2984 7.80039 26.5328C8.03481 26.7672 8.1665 27.0851 8.1665 27.4167C8.1665 27.7482 8.03481 28.0661 7.80039 28.3005C7.56597 28.535 7.24802 28.6667 6.9165 28.6667C6.58498 28.6667 6.26704 28.535 6.03262 28.3005C5.7982 28.0661 5.6665 27.7482 5.6665 27.4167ZM11.9165 16.1667C11.585 16.1667 11.267 16.2984 11.0326 16.5328C10.7982 16.7672 10.6665 17.0851 10.6665 17.4167C10.6665 17.7482 10.7982 18.0661 11.0326 18.3005C11.267 18.535 11.585 18.6667 11.9165 18.6667H21.0832C21.4147 18.6667 21.7326 18.535 21.9671 18.3005C22.2015 18.0661 22.3332 17.7482 22.3332 17.4167C22.3332 17.0851 22.2015 16.7672 21.9671 16.5328C21.7326 16.2984 21.4147 16.1667 21.0832 16.1667H11.9165ZM10.6665 22.4167C10.6665 22.0851 10.7982 21.7672 11.0326 21.5328C11.267 21.2984 11.585 21.1667 11.9165 21.1667H21.0832C21.4147 21.1667 21.7326 21.2984 21.9671 21.5328C22.2015 21.7672 22.3332 22.0851 22.3332 22.4167C22.3332 22.7482 22.2015 23.0661 21.9671 23.3005C21.7326 23.535 21.4147 23.6667 21.0832 23.6667H11.9165C11.585 23.6667 11.267 23.535 11.0326 23.3005C10.7982 23.0661 10.6665 22.7482 10.6665 22.4167ZM11.9165 26.1667C11.585 26.1667 11.267 26.2984 11.0326 26.5328C10.7982 26.7672 10.6665 27.0851 10.6665 27.4167C10.6665 27.7482 10.7982 28.0661 11.0326 28.3005C11.267 28.535 11.585 28.6667 11.9165 28.6667H21.0832C21.4147 28.6667 21.7326 28.535 21.9671 28.3005C22.2015 28.0661 22.3332 27.7482 22.3332 27.4167C22.3332 27.0851 22.2015 26.7672 21.9671 26.5328C21.7326 26.2984 21.4147 26.1667 21.0832 26.1667H11.9165ZM26.3565 11.0233L16.6415 1.31C16.6157 1.28605 16.5885 1.26378 16.5598 1.24333C16.5392 1.22742 16.5192 1.21074 16.4998 1.19333C16.3852 1.08512 16.2632 0.984882 16.1348 0.893332C16.0922 0.865802 16.0476 0.841298 16.0015 0.819999L15.9215 0.779999L15.8382 0.731666C15.7482 0.679999 15.6565 0.626665 15.5615 0.586665C15.2296 0.454104 14.8783 0.376423 14.5215 0.356665C14.4885 0.354519 14.4557 0.350625 14.4232 0.344999C14.3779 0.338012 14.3323 0.334114 14.2865 0.333332H3.99984C3.11578 0.333332 2.26794 0.684521 1.64281 1.30964C1.01769 1.93476 0.666504 2.78261 0.666504 3.66667V30.3333C0.666504 31.2174 1.01769 32.0652 1.64281 32.6904C2.26794 33.3155 3.11578 33.6667 3.99984 33.6667H23.9998C24.8839 33.6667 25.7317 33.3155 26.3569 32.6904C26.982 32.0652 27.3332 31.2174 27.3332 30.3333V13.38C27.333 12.496 26.9817 11.6483 26.3565 11.0233ZM24.8332 30.3333C24.8332 30.5543 24.7454 30.7663 24.5891 30.9226C24.4328 31.0789 24.2208 31.1667 23.9998 31.1667H3.99984C3.77882 31.1667 3.56686 31.0789 3.41058 30.9226C3.2543 30.7663 3.1665 30.5543 3.1665 30.3333V3.66667C3.1665 3.44565 3.2543 3.23369 3.41058 3.07741C3.56686 2.92113 3.77882 2.83333 3.99984 2.83333H13.9998V10.3333C13.9998 11.2174 14.351 12.0652 14.9761 12.6904C15.6013 13.3155 16.4491 13.6667 17.3332 13.6667H24.8332V30.3333ZM16.4998 4.70166L22.9632 11.1667H17.3332C17.1122 11.1667 16.9002 11.0789 16.7439 10.9226C16.5876 10.7663 16.4998 10.5543 16.4998 10.3333V4.70166Z"
fill="black"
@ -143,12 +324,24 @@ const NewContent = () => {
<div className="flex flex-col flex-1">
<div className="text-gray-500 dark:text-gray-400 flex flex-row text-sm">
{description.date} | <Icon icon="formkit:eye" width="15" height="15" /> 518
{description.date} |{" "}
<Icon icon="formkit:eye" width="15" height="15" />{" "}
518
</div>
<div className="font-semibold text-gray-900 dark:text-white mt-1 text-sm">
{textEllipsis(description.title, 50)}
</div>
<div className="font-semibold text-gray-900 dark:text-white mt-1 text-sm">{textEllipsis(description.title, 50)}</div>
<div className="flex gap-2 items-center text-sm text-red-500 dark:text-red-500">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512">
<path fill="#f00" d="M224 30v256h-64l96 128l96-128h-64V30zM32 434v48h448v-48z" />
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 512 512"
>
<path
fill="#f00"
d="M224 30v256h-64l96 128l96-128h-64V30zM32 434v48h448v-48z"
/>
</svg>
Download Dokumen
</div>
@ -165,7 +358,10 @@ const NewContent = () => {
</div>
</div>
<div className="flex items-center flex-row justify-center">
<Link href="#" className="border text-[#bb3523] text-sm lg:text-md px-4 py-1 border-[#bb3523]">
<Link
href="#"
className="border text-[#bb3523] text-sm lg:text-md px-4 py-1 border-[#bb3523]"
>
LIHAT SEMUA
</Link>
</div>

View File

@ -2,11 +2,28 @@ import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import Cookies from "js-cookie";
import CryptoJS from "crypto-js";
import Swal from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
import Loading from "@/app/[locale]/(protected)/app/projects/loading";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
const MySwal = withReactContent(Swal);
const Toast = MySwal.mixin({
toast: true,
position: "top-end",
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener("mouseenter", Swal.stopTimer);
toast.addEventListener("mouseleave", Swal.resumeTimer);
},
});
export const hexToRGB = (hex: any, alpha?: number): any => {
const r = parseInt(hex.slice(1, 3), 16);
const g = parseInt(hex.slice(3, 5), 16);
@ -65,3 +82,26 @@ export function getCookiesDecrypt(param: any) {
console.log("Error", cookiesEncrypt);
}
}
export function successToast(title: string, text: string) {
Toast.fire({
icon: "error",
title: title,
text: text,
});
}
export function setCookiesEncrypt(param: any, data: any) {
// Enkripsi data
const cookiesEncrypt = CryptoJS.AES.encrypt(
JSON.stringify(data),
`${param}_EncryptKey@mediahub`
).toString(); // Tambahkan .toString() di sini
// Simpan data terenkripsi di cookie
Cookies.set(param, cookiesEncrypt, { expires: 1 });
}
export function error(msg: any) {
MySwal.fire("Gagal", msg, "error");
}

143
package-lock.json generated
View File

@ -57,6 +57,7 @@
"@types/crypto-js": "^4.2.2",
"@types/js-cookie": "^3.0.6",
"@types/qs": "^6.9.17",
"@types/react-google-recaptcha": "^2.1.9",
"@types/react-syntax-highlighter": "^15.5.13",
"@vercel/analytics": "^1.3.1",
"apexcharts": "^3.49.2",
@ -109,7 +110,7 @@
"react-quill": "^0.0.2",
"react-resizable-panels": "^2.0.19",
"react-responsive": "^10.0.0",
"react-select": "^5.8.0",
"react-select": "^5.8.3",
"react-slick": "^0.30.2",
"react-syntax-highlighter": "^15.5.0",
"react-time-picker": "^7.0.0",
@ -147,6 +148,7 @@
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz",
"integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==",
"dev": true,
"engines": {
"node": ">=10"
},
@ -883,6 +885,7 @@
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
"dev": true,
"dependencies": {
"string-width": "^5.1.2",
"string-width-cjs": "npm:string-width@^4.2.0",
@ -899,6 +902,7 @@
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
"dev": true,
"engines": {
"node": ">=12"
},
@ -910,6 +914,7 @@
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dev": true,
"dependencies": {
"ansi-regex": "^6.0.1"
},
@ -1245,6 +1250,7 @@
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"dev": true,
"dependencies": {
"@nodelib/fs.stat": "2.0.5",
"run-parallel": "^1.1.9"
@ -1257,6 +1263,7 @@
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"dev": true,
"engines": {
"node": ">= 8"
}
@ -1265,6 +1272,7 @@
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"dev": true,
"dependencies": {
"@nodelib/fs.scandir": "2.1.5",
"fastq": "^1.6.0"
@ -1294,6 +1302,7 @@
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"dev": true,
"optional": true,
"engines": {
"node": ">=14"
@ -3118,7 +3127,7 @@
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.1.tgz",
"integrity": "sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==",
"devOptional": true,
"dev": true,
"dependencies": {
"@types/react": "*"
}
@ -3129,6 +3138,14 @@
"integrity": "sha512-vkDID5kZwYRplECuUtAbPnRN9XyrzE+9lxl0VBV+h7pFDOc6hn+0xieswO7Wrzne/J9HstA3Nlb6OeMuuQxjuw==",
"dev": true
},
"node_modules/@types/react-google-recaptcha": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@types/react-google-recaptcha/-/react-google-recaptcha-2.1.9.tgz",
"integrity": "sha512-nT31LrBDuoSZJN4QuwtQSF3O89FVHC4jLhM+NtKEmVF5R1e8OY0Jo4//x2Yapn2aNHguwgX5doAq8Zo+Ehd0ug==",
"dependencies": {
"@types/react": "*"
}
},
"node_modules/@types/react-syntax-highlighter": {
"version": "15.5.13",
"resolved": "https://registry.npmjs.org/@types/react-syntax-highlighter/-/react-syntax-highlighter-15.5.13.tgz",
@ -3395,6 +3412,7 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"engines": {
"node": ">=8"
}
@ -3408,6 +3426,7 @@
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"dependencies": {
"color-convert": "^2.0.1"
},
@ -3421,12 +3440,14 @@
"node_modules/any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
"integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="
"integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
"dev": true
},
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dev": true,
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
@ -3471,7 +3492,8 @@
"node_modules/arg": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
"integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="
"integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",
"dev": true
},
"node_modules/argparse": {
"version": "2.0.1",
@ -3762,12 +3784,14 @@
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
"dev": true,
"engines": {
"node": ">=8"
},
@ -3789,6 +3813,7 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"dependencies": {
"fill-range": "^7.1.1"
},
@ -3837,6 +3862,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz",
"integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==",
"dev": true,
"engines": {
"node": ">= 6"
}
@ -3936,6 +3962,7 @@
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"dev": true,
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
@ -3959,6 +3986,7 @@
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"dependencies": {
"is-glob": "^4.0.1"
},
@ -4151,6 +4179,7 @@
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
@ -4160,10 +4189,21 @@
"node": ">= 8"
}
},
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/css-mediaquery": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz",
"integrity": "sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q=="
},
"node_modules/cssesc": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"dev": true,
"bin": {
"cssesc": "bin/cssesc"
},
@ -4826,7 +4866,8 @@
"node_modules/didyoumean": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",
"integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw=="
"integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==",
"dev": true
},
"node_modules/diff": {
"version": "5.2.0",
@ -4851,7 +4892,8 @@
"node_modules/dlv": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",
"integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA=="
"integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",
"dev": true
},
"node_modules/doctrine": {
"version": "3.0.0",
@ -4939,7 +4981,8 @@
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
"dev": true
},
"node_modules/elkjs": {
"version": "0.9.3",
@ -4987,7 +5030,8 @@
"node_modules/emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
"dev": true
},
"node_modules/enhanced-resolve": {
"version": "5.17.1",
@ -5830,6 +5874,7 @@
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
"integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
"dev": true,
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
@ -5845,6 +5890,7 @@
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"dependencies": {
"is-glob": "^4.0.1"
},
@ -5868,6 +5914,7 @@
"version": "1.17.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
"integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
"dev": true,
"dependencies": {
"reusify": "^1.0.4"
}
@ -5911,6 +5958,7 @@
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
},
@ -6001,6 +6049,7 @@
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz",
"integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.0",
"signal-exit": "^4.0.1"
@ -6208,6 +6257,7 @@
"version": "10.3.10",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
"integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
"dev": true,
"dependencies": {
"foreground-child": "^3.1.0",
"jackspeak": "^2.3.5",
@ -6229,6 +6279,7 @@
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
"integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
"dev": true,
"dependencies": {
"is-glob": "^4.0.3"
},
@ -6240,6 +6291,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
"dependencies": {
"balanced-match": "^1.0.0"
}
@ -6248,6 +6300,7 @@
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
"dev": true,
"dependencies": {
"brace-expansion": "^2.0.1"
},
@ -7208,6 +7261,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dev": true,
"dependencies": {
"binary-extensions": "^2.0.0"
},
@ -7339,6 +7393,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
@ -7362,6 +7417,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true,
"engines": {
"node": ">=8"
}
@ -7385,6 +7441,7 @@
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"dependencies": {
"is-extglob": "^2.1.1"
},
@ -7429,6 +7486,7 @@
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"engines": {
"node": ">=0.12.0"
}
@ -7671,6 +7729,7 @@
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",
"integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",
"dev": true,
"dependencies": {
"@isaacs/cliui": "^8.0.2"
},
@ -7688,6 +7747,7 @@
"version": "1.21.6",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz",
"integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==",
"dev": true,
"bin": {
"jiti": "bin/jiti.js"
}
@ -7946,6 +8006,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz",
"integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==",
"dev": true,
"engines": {
"node": ">=10"
}
@ -8046,7 +8107,8 @@
"node_modules/lru-cache": {
"version": "10.4.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
"dev": true
},
"node_modules/lucide-react": {
"version": "0.390.0",
@ -8760,6 +8822,7 @@
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"dev": true,
"engines": {
"node": ">= 8"
}
@ -9547,6 +9610,7 @@
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
@ -9607,6 +9671,7 @@
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"dev": true,
"engines": {
"node": ">=16 || 14 >=14.17"
}
@ -9655,6 +9720,7 @@
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
"integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
"dev": true,
"dependencies": {
"any-promise": "^1.0.0",
"object-assign": "^4.0.1",
@ -9949,6 +10015,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
@ -10003,6 +10070,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz",
"integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",
"dev": true,
"engines": {
"node": ">= 6"
}
@ -10301,6 +10369,7 @@
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
"engines": {
"node": ">=8"
}
@ -10314,6 +10383,7 @@
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
"dev": true,
"dependencies": {
"lru-cache": "^10.2.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
@ -10352,6 +10422,7 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"engines": {
"node": ">=8.6"
},
@ -10363,6 +10434,7 @@
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
@ -10371,6 +10443,7 @@
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz",
"integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==",
"dev": true,
"engines": {
"node": ">= 6"
}
@ -10388,6 +10461,7 @@
"version": "8.4.49",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz",
"integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==",
"dev": true,
"funding": [
{
"type": "opencollective",
@ -10415,6 +10489,7 @@
"version": "15.1.0",
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz",
"integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==",
"dev": true,
"dependencies": {
"postcss-value-parser": "^4.0.0",
"read-cache": "^1.0.0",
@ -10431,6 +10506,7 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz",
"integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==",
"dev": true,
"dependencies": {
"camelcase-css": "^2.0.1"
},
@ -10449,6 +10525,7 @@
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz",
"integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==",
"dev": true,
"funding": [
{
"type": "opencollective",
@ -10483,6 +10560,7 @@
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz",
"integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==",
"dev": true,
"engines": {
"node": ">=14"
},
@ -10494,6 +10572,7 @@
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
"integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==",
"dev": true,
"bin": {
"yaml": "bin.mjs"
},
@ -10505,6 +10584,7 @@
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz",
"integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==",
"dev": true,
"funding": [
{
"type": "opencollective",
@ -10529,6 +10609,7 @@
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",
"integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==",
"dev": true,
"dependencies": {
"cssesc": "^3.0.0",
"util-deprecate": "^1.0.2"
@ -10540,7 +10621,8 @@
"node_modules/postcss-value-parser": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
"dev": true
},
"node_modules/preact": {
"version": "10.12.1",
@ -10645,6 +10727,7 @@
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true,
"funding": [
{
"type": "github",
@ -11156,6 +11239,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
"integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==",
"dev": true,
"dependencies": {
"pify": "^2.3.0"
}
@ -11164,6 +11248,7 @@
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dev": true,
"dependencies": {
"picomatch": "^2.2.1"
},
@ -11585,6 +11670,7 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
"integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
"dev": true,
"engines": {
"iojs": ">=1.0.0",
"node": ">=0.10.0"
@ -11657,6 +11743,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"dev": true,
"funding": [
{
"type": "github",
@ -11848,6 +11935,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"dependencies": {
"shebang-regex": "^3.0.0"
},
@ -11859,6 +11947,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true,
"engines": {
"node": ">=8"
}
@ -11895,6 +11984,7 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
"engines": {
"node": ">=14"
},
@ -12018,6 +12108,7 @@
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"dev": true,
"dependencies": {
"eastasianwidth": "^0.2.0",
"emoji-regex": "^9.2.2",
@ -12035,6 +12126,7 @@
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
@ -12047,12 +12139,14 @@
"node_modules/string-width-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"node_modules/string-width/node_modules/ansi-regex": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
"dev": true,
"engines": {
"node": ">=12"
},
@ -12064,6 +12158,7 @@
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dev": true,
"dependencies": {
"ansi-regex": "^6.0.1"
},
@ -12199,6 +12294,7 @@
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
@ -12211,6 +12307,7 @@
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
@ -12315,6 +12412,7 @@
"version": "3.35.0",
"resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz",
"integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==",
"dev": true,
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.2",
"commander": "^4.0.0",
@ -12336,6 +12434,7 @@
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
"integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
"dev": true,
"engines": {
"node": ">= 6"
}
@ -12509,6 +12608,7 @@
"version": "3.4.15",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.15.tgz",
"integrity": "sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==",
"dev": true,
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"arg": "^5.0.2",
@ -12568,6 +12668,7 @@
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
"integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",
"dev": true,
"dependencies": {
"any-promise": "^1.0.0"
}
@ -12576,6 +12677,7 @@
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",
"integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",
"dev": true,
"dependencies": {
"thenify": ">= 3.1.0 < 4"
},
@ -12683,6 +12785,7 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"dependencies": {
"is-number": "^7.0.0"
},
@ -12740,7 +12843,8 @@
"node_modules/ts-interface-checker": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
"integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="
"integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==",
"dev": true
},
"node_modules/tsconfig-paths": {
"version": "3.15.0",
@ -13219,7 +13323,8 @@
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true
},
"node_modules/uuid": {
"version": "9.0.1",
@ -13458,6 +13563,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"dependencies": {
"isexe": "^2.0.0"
},
@ -13561,6 +13667,7 @@
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^6.1.0",
"string-width": "^5.0.1",
@ -13578,6 +13685,7 @@
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
@ -13593,12 +13701,14 @@
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
@ -13612,6 +13722,7 @@
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
"dev": true,
"engines": {
"node": ">=12"
},
@ -13623,6 +13734,7 @@
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"dev": true,
"engines": {
"node": ">=12"
},
@ -13634,6 +13746,7 @@
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dev": true,
"dependencies": {
"ansi-regex": "^6.0.1"
},

View File

@ -58,6 +58,7 @@
"@types/crypto-js": "^4.2.2",
"@types/js-cookie": "^3.0.6",
"@types/qs": "^6.9.17",
"@types/react-google-recaptcha": "^2.1.9",
"@types/react-syntax-highlighter": "^15.5.13",
"@vercel/analytics": "^1.3.1",
"apexcharts": "^3.49.2",
@ -110,7 +111,7 @@
"react-quill": "^0.0.2",
"react-resizable-panels": "^2.0.19",
"react-responsive": "^10.0.0",
"react-select": "^5.8.0",
"react-select": "^5.8.3",
"react-slick": "^0.30.2",
"react-syntax-highlighter": "^15.5.0",
"react-time-picker": "^7.0.0",

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

View File

@ -0,0 +1,103 @@
<svg width="717" height="644" viewBox="0 0 717 644" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_5413_6301" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="717" height="652">
<line x1="2.5" y1="651.047" x2="2.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="10.5" y1="651.047" x2="10.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="18.5" y1="651.047" x2="18.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="26.5" y1="651.047" x2="26.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="34.5" y1="651.047" x2="34.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="42.5" y1="651.047" x2="42.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="50.5" y1="651.047" x2="50.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="58.5" y1="651.047" x2="58.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="66.5" y1="651.047" x2="66.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="74.5" y1="651.047" x2="74.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="82.5" y1="651.047" x2="82.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="90.5" y1="651.047" x2="90.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="98.5" y1="651.047" x2="98.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="106.5" y1="651.047" x2="106.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="114.5" y1="651.047" x2="114.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="122.5" y1="651.047" x2="122.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="130.5" y1="651.047" x2="130.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="138.5" y1="651.047" x2="138.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="146.5" y1="651.047" x2="146.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="154.5" y1="651.047" x2="154.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="162.5" y1="651.047" x2="162.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="170.5" y1="651.047" x2="170.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="178.5" y1="651.047" x2="178.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="186.5" y1="651.047" x2="186.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="194.5" y1="651.047" x2="194.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="202.5" y1="651.047" x2="202.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="210.5" y1="651.047" x2="210.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="218.5" y1="651.047" x2="218.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="226.5" y1="651.047" x2="226.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="234.5" y1="651.047" x2="234.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="242.5" y1="651.047" x2="242.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="250.5" y1="651.047" x2="250.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="258.5" y1="651.047" x2="258.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="266.5" y1="651.047" x2="266.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="274.5" y1="651.047" x2="274.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="282.5" y1="651.047" x2="282.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="290.5" y1="651.047" x2="290.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="298.5" y1="651.047" x2="298.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="306.5" y1="651.047" x2="306.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="314.5" y1="651.047" x2="314.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="322.5" y1="651.047" x2="322.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="330.5" y1="651.047" x2="330.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="338.5" y1="651.047" x2="338.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="346.5" y1="651.047" x2="346.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="354.5" y1="651.047" x2="354.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="362.5" y1="651.047" x2="362.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="370.5" y1="651.047" x2="370.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="378.5" y1="651.047" x2="378.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="386.5" y1="651.047" x2="386.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="394.5" y1="651.047" x2="394.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="402.5" y1="651.047" x2="402.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="410.5" y1="651.047" x2="410.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="418.5" y1="651.047" x2="418.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="426.5" y1="651.047" x2="426.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="434.5" y1="651.047" x2="434.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="442.5" y1="651.047" x2="442.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="450.5" y1="651.047" x2="450.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="458.5" y1="651.047" x2="458.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="466.5" y1="651.047" x2="466.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="474.5" y1="651.047" x2="474.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="482.5" y1="651.047" x2="482.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="490.5" y1="651.047" x2="490.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="498.5" y1="651.047" x2="498.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="506.5" y1="651.047" x2="506.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="514.5" y1="651.047" x2="514.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="522.5" y1="651.047" x2="522.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="530.5" y1="651.047" x2="530.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="538.5" y1="651.047" x2="538.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="546.5" y1="651.047" x2="546.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="554.5" y1="651.047" x2="554.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="562.5" y1="651.047" x2="562.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="570.5" y1="651.047" x2="570.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="578.5" y1="651.047" x2="578.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="586.5" y1="651.047" x2="586.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="594.5" y1="651.047" x2="594.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="602.5" y1="651.047" x2="602.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="610.5" y1="651.047" x2="610.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="618.5" y1="651.047" x2="618.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="626.5" y1="651.047" x2="626.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="634.5" y1="651.047" x2="634.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="642.5" y1="651.047" x2="642.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="650.5" y1="651.047" x2="650.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="658.5" y1="651.047" x2="658.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="666.5" y1="651.047" x2="666.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="674.5" y1="651.047" x2="674.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="682.5" y1="651.047" x2="682.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="690.5" y1="651.047" x2="690.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="698.5" y1="651.047" x2="698.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="706.5" y1="651.047" x2="706.5" y2="0.954285" stroke="black" stroke-width="4"/>
<line x1="714.5" y1="651.047" x2="714.5" y2="0.954285" stroke="black" stroke-width="4"/>
</mask>
<g mask="url(#mask0_5413_6301)">
<path d="M54.5008 225.366V381.119H18.2463H-8V643.953H717V381.119H656V288.006V215.208H618V260.918V288.006H579.129V355.724H560.626V172.883L549.883 164.419V128.866H543.915V164.419L530.784 172.883V355.724L499.748 335.409V100.086H414.996V335.409H378V260.918H324.275V225.366H258.622V30.6738H168V381.119H112.992V240.602H85.5368V172.883L54.5008 225.366Z" fill="url(#paint0_linear_5413_6301)"/>
</g>
<defs>
<linearGradient id="paint0_linear_5413_6301" x1="354" y1="348.689" x2="354.78" y2="741.493" gradientUnits="userSpaceOnUse">
<stop stop-color="#8B8686"/>
<stop offset="1" stop-color="#1B1A1A" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

94
service/auth.ts Normal file
View File

@ -0,0 +1,94 @@
import Cookies from "js-cookie";
import { getAPI, postAPI, postAPIWithJson } from "../config/api";
import { getAPIDummy } from "./http-config/axiosCustom";
export async function setLogin(data) {
const url = "signin";
return postAPI({ url, data });
}
export async function getProfile(token) {
const url = "users/info";
return getAPI({ url, token });
}
export async function saveSession(data) {
const url = "users/save-session";
return postAPIWithJson({ url, data });
}
export async function checkSession(data) {
const url = "users/check-session";
return postAPIWithJson({ url, data });
}
export async function listProvince() {
const url = "public/users/provinces";
return getAPI({ url });
}
export async function listCity(id) {
const url = `public/users/cities?provId=${id}`;
return getAPI({ url });
}
export async function listDistricts(id) {
const url = `public/users/districts?cityId=${id}`;
return getAPI({ url });
}
export async function listInstitusi(roleId) {
const url = `public/users/institutes?categoryRoleId=${roleId}`;
return getAPI({ url });
}
export async function listRole() {
const url = "public/users/roles";
return getAPI({ url });
}
export async function refreshToken() {
const url = "signin";
const data = {
grant_type: "refresh_token",
client_id: "mediahub-app",
refresh_token: Cookies.get("refresh_token"),
};
return postAPI({ url, data });
}
export async function postRegistration(data) {
const url = "public/users/save";
return postAPIWithJson({ url, data });
}
export async function saveInstitutes(data) {
const url = "public/users/save-institutes";
return postAPIWithJson({ url, data });
}
export async function forgotPassword(username) {
const url = `forgot-password?username=${username}`;
return postAPIWithJson({ url });
}
export async function getDataByNIK(reqid, nik) {
const url = `http://spitpolri.com/api/back_end/get_ktp?reqid=${reqid}&nik=${nik}`;
return getAPIDummy({ url });
}
export async function getDataByNRP(reqid, nrp) {
const url = `http://spitpolri.com/api/back_end/get_nrp?reqid=${reqid}&nrp=${nrp}`;
return getAPIDummy({ url });
}
export async function getDataJournalist(cert) {
const url = `public/users/search-journalist?cert=${cert}`;
return getAPI({ url });
}
export async function getDataPersonil(nrp) {
const url = `public/users/search-personil?nrp=${nrp}`;
return getAPI({ url });
}

View File

@ -0,0 +1,29 @@
import { getAPIInterceptor } from "@/config/api";
import {
httpGetInterceptor,
httpPostInterceptor,
} from "../http-config/http-interceptor-service";
export async function listTicketingInternal(page: number) {
return await httpGetInterceptor(
`ticketing/internal/pagination?enablePage=1&size=10&page=${page}`
);
}
export async function getCuratorUser() {
return await httpGetInterceptor("users/collaboration?enablePage=0");
}
export async function getTicketingPriority() {
return await httpGetInterceptor("ticketing/priority");
}
export async function saveTicketingInternal(data: any) {
const url = "ticketing/internal";
return httpPostInterceptor(url, data);
}
export async function saveTicketing(data: any) {
const url = "ticketing";
return httpPostInterceptor(url, data);
}

View File

@ -0,0 +1,15 @@
import {
httpGetInterceptor,
httpPostInterceptor,
} from "../http-config/http-interceptor-service";
export async function listContest(size: number, page: number) {
return await httpGetInterceptor(
`contest/pagination?enablePage=1&size=${size}&page=${page}`
);
}
export async function createTask(data: any) {
const url = "assignment";
return httpPostInterceptor(url, data);
}

View File

@ -0,0 +1,17 @@
import axios from "axios";
export async function getAPIDummy(url: any) {
const response = await axios.get(url).catch((error) => error.response);
if (response?.status > 300) {
return {
error: true,
message: response?.data?.error_description,
data: null,
};
}
return {
error: false,
message: "success",
data: response?.data,
};
}

View File

@ -1,17 +1,19 @@
import { getAPI, getAPIInterceptor } from "@/config/api";
import { httpGet, httpPost } from "./http-config/http-base-service";
import { httpGetInterceptor, httpGetInterceptorWithToken } from "./http-config/http-interceptor-service";
import {
httpGetInterceptor,
httpGetInterceptorWithToken,
} from "./http-config/http-interceptor-service";
export async function login(data: any) {
const pathUrl = `users/login`;
const headers = {
"content-type": "application/json",
};
return await httpPost(pathUrl, headers, data);
const pathUrl = `signin`;
const headers = {
"content-type": "application/json",
};
return await httpPost(pathUrl, headers, data);
}
export async function userInfo(token: any) {
const pathUrl = `users/info`;
return await httpGetInterceptorWithToken(pathUrl, token);
const pathUrl = `users/info`;
return await httpGetInterceptorWithToken(pathUrl, token);
}

View File

@ -19,10 +19,6 @@ export async function getListCategories(size: number, page: number) {
);
}
export async function listTask(size: number, page: number) {
return await httpGetInterceptor(`assignment/list?size=${size}&page=${page}`);
}
export async function updateCategoryPosition(category: any) {
const pathUrl = `/ppid-data-categories/position`;
return await httpPostInterceptor(pathUrl, category);

View File

@ -3,10 +3,18 @@ import {
getAPIInterceptor,
postAPIInterceptor,
} from "../config/api";
import {
httpGetInterceptor,
httpPostInterceptor,
} from "./http-config/http-interceptor-service";
export async function listTask(page: any, limit: any) {
const url = `assignment/list?enablePage=1&size=${limit}&page=${page}`;
return getAPIInterceptor({ url });
export async function listTask(size: number, page: number) {
return await httpGetInterceptor(`assignment/list?size=${size}&page=${page}`);
}
export async function createTask(data: any) {
const url = "assignment";
return httpPostInterceptor(url, data);
}
export async function getTask(id: any) {
@ -14,11 +22,6 @@ export async function getTask(id: any) {
return getAPIInterceptor({ url });
}
export async function createTask(data: any) {
const url = "assignment";
return postAPIInterceptor(url, data); // Perbaikan: Memisahkan parameter url dan data
}
export async function forwardTask(data: any) {
const url = "assignment/forward";
return postAPIInterceptor(url, data);