feat: add rewrite section
This commit is contained in:
parent
308d07d1ff
commit
7c8c4f434b
|
|
@ -13,6 +13,9 @@ import withReactContent from "sweetalert2-react-content";
|
|||
import { getCookiesDecrypt } from "@/lib/utils";
|
||||
import Swal from "sweetalert2";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
import { Icon } from "@iconify/react/dist/iconify.js";
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
const Galery = (props: any) => {
|
||||
const [profile, setProfile] = useState<any>();
|
||||
|
|
@ -28,7 +31,7 @@ const Galery = (props: any) => {
|
|||
const { isInstitute, instituteId } = props;
|
||||
const userId = getCookiesDecrypt("uie");
|
||||
const userRoleId = getCookiesDecrypt("urie");
|
||||
|
||||
const { toast } = useToast();
|
||||
const [totalContent, setTotalContent] = useState();
|
||||
const [categoryFilter] = useState([]);
|
||||
const [formatFilter] = useState([]);
|
||||
|
|
@ -217,6 +220,9 @@ const Galery = (props: any) => {
|
|||
await navigator.clipboard.writeText(`https://mediahub.polri.go.id/video/detail/${url}`);
|
||||
setCopySuccess("Copied");
|
||||
// toast.success("Link Berhasil Di Copy");
|
||||
toast({
|
||||
title: "Link Berhasil Di Copy",
|
||||
});
|
||||
};
|
||||
|
||||
const [hasMounted, setHasMounted] = useState(false);
|
||||
|
|
@ -277,12 +283,44 @@ const Galery = (props: any) => {
|
|||
contentVideo?.length > 0 ? (
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{contentVideo?.map((video: any) => (
|
||||
<Card key={video?.id} className="hover:scale-110 transition-transform duration-300">
|
||||
<Card key={video?.id}>
|
||||
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
||||
<Link href={`/video/detail/${video?.mediaUpload?.slug}`}>
|
||||
<img src={video?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" />
|
||||
<div>
|
||||
<Link href={`/video/detail/${video?.mediaUpload?.slug}`}>
|
||||
<img src={video?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" />
|
||||
</Link>
|
||||
|
||||
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{video?.mediaUpload?.title}</div>
|
||||
</Link>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger className="flex items-center gap-1">
|
||||
<a >
|
||||
<Icon className="text-white ml-1" fontSize={25} icon="tabler:dots" />
|
||||
</a>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuItem>
|
||||
<button onClick={() => handleSaveWishlist(video?.mediaUpload?.id)} className="flex items-center gap-1 hover:bg-slate-600 w-full rounded-lg">
|
||||
<Icon icon="material-symbols:bookmark-outline" fontSize={20} />
|
||||
<p className="text-base font-semibold">Simpan</p>
|
||||
</button>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
<Link href={`/content-management/rewrite/create/${video?.mediaUpload?.slug}`} className="flex items-center gap-1 hover:bg-slate-600 w-full rounded-lg">
|
||||
<Icon icon="jam:write" fontSize={20} />
|
||||
<p className="text-base font-semibold">Content Rewrite</p>
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
<div className="flex items-center gap-1 hover:bg-slate-600 w-full rounded-lg">
|
||||
<button onClick={() => copyToClip(video.mediaUpload?.slug)} className="w-full flex items-center gap-2">
|
||||
<Icon icon="oi:share" fontSize={20} />
|
||||
<p className="text-base font-semibold">Bagikan</p>
|
||||
</button>
|
||||
</div>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,145 @@
|
|||
"use client";
|
||||
|
||||
import HeaderManagement from "@/components/landing-page/header-management";
|
||||
import SidebarManagement from "@/components/landing-page/sidebar-management";
|
||||
import { useRouter } from "@/i18n/routing";
|
||||
import { getCookiesDecrypt } from "@/lib/utils";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import React, { useState } from "react";
|
||||
import Swal from "sweetalert2";
|
||||
import withReactContent from "sweetalert2-react-content";
|
||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
|
||||
const page = () => {
|
||||
// const { states } = props;
|
||||
const [profile, setProfile] = useState();
|
||||
const MySwal = withReactContent(Swal);
|
||||
const router = useRouter();
|
||||
const [, setLoadingState] = useState(false);
|
||||
const searchParams = useSearchParams();
|
||||
const id: any = searchParams?.get("title");
|
||||
const [content, setContent] = useState([]);
|
||||
const [isFromSPIT, setIsFromSPIT] = useState(false);
|
||||
const [listSuggestion, setListSuggestion] = useState();
|
||||
const [main, setMain] = useState();
|
||||
const userId = getCookiesDecrypt("uie");
|
||||
const userRoleId = getCookiesDecrypt("urie");
|
||||
const [articleIds, setArticleIds] = useState([]);
|
||||
const [isGeneratedArticle, setIsGeneratedArticle] = useState(false);
|
||||
const [selectedArticleId, setSelectedArticleId] = useState(null);
|
||||
const [articleBody, setArticleBody] = useState("");
|
||||
const [selectedAdvConfig, setSelectedAdvConfig] = useState("");
|
||||
const [selectedWritingStyle, setSelectedWritingStyle] = useState("");
|
||||
const [selectedContextType, setSelectedContextType] = useState("");
|
||||
const [selectedLanguage, setSelectedLanguage] = useState("");
|
||||
const [selectedTitle, setSelectedTitle] = useState("");
|
||||
const [selectedMainKeyword, setSelectedMainKeyword] = useState("");
|
||||
const [selectedSEO, setSelectedSEO] = useState("");
|
||||
const [selectedSize, setSelectedSize] = useState("");
|
||||
const [detailArticle, setDetailArticle] = useState(null);
|
||||
const [contentType, setContentType] = useState("all");
|
||||
|
||||
const userLevelId = getCookiesDecrypt("ulie");
|
||||
const roleId = getCookiesDecrypt("urie");
|
||||
return (
|
||||
<>
|
||||
<HeaderManagement />
|
||||
|
||||
<div className="flex flex-row">
|
||||
<SidebarManagement />
|
||||
<div className="w-2/3 p-12">
|
||||
<div className="flex flex-col">
|
||||
<div className="text-xl font-bold mb-5">Content Rewrite</div>
|
||||
<div className="p-8 border border-black rounded-lg">
|
||||
<form>
|
||||
<div className="flex flex-row gap-2 justify-between mb-3">
|
||||
<div className="gap-1">
|
||||
<p className="font-semibold">Bahasa</p>
|
||||
<Select value={selectedLanguage} onValueChange={(e: any) => setSelectedLanguage(e.target.value)}>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue placeholder="Pilih Bahasa" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Pilih Bahasa</SelectLabel>
|
||||
<SelectItem value="indonesia">Indonesia</SelectItem>
|
||||
<SelectItem value="english">English</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="gap-1">
|
||||
<p className="font-semibold">Context Type</p>
|
||||
<Select value={selectedContextType} onValueChange={(e: any) => setSelectedContextType(e.target.value)}>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue placeholder="Select Context" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Select Context Type</SelectLabel>
|
||||
<SelectItem value="text">Text</SelectItem>
|
||||
<SelectItem value="article">Article</SelectItem>
|
||||
<SelectItem value="transcript">Transcript</SelectItem>
|
||||
<SelectItem value="url">URL</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="gap-1">
|
||||
<p className="font-semibold">Writing Style</p>
|
||||
<Select value={selectedWritingStyle} onValueChange={(e: any) => setSelectedWritingStyle(e.target.value)}>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue placeholder="Select Writing" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Select Writing Style</SelectLabel>
|
||||
<SelectItem value="firendly">Friendly</SelectItem>
|
||||
<SelectItem value="profesional">Profesional</SelectItem>
|
||||
<SelectItem value="informational">Informational</SelectItem>
|
||||
<SelectItem value="neutral">Neutral</SelectItem>
|
||||
<SelectItem value="witty">Witty</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="gap-1">
|
||||
<p className="font-semibold">Article Size</p>
|
||||
<Select value={selectedSize} onValueChange={(e: any) => setSelectedSize(e.target.value)}>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue placeholder="Select Size" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Select Article Size</SelectLabel>
|
||||
<SelectItem value="news">News (300 - 900 words)</SelectItem>
|
||||
<SelectItem value="info">Info (900 - 2000 words)</SelectItem>
|
||||
<SelectItem value="detail">Detail (2000 - 5000 words)</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xl font-semibold mb-5">Judul</p>
|
||||
<input
|
||||
type="text"
|
||||
className="w-full border rounded-lg"
|
||||
// {...register("title", {
|
||||
// value: content?.title,
|
||||
// })}
|
||||
id="title"
|
||||
// defaultValue={content?.title}
|
||||
// onChange={(e) => setSelectedTitle(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default page;
|
||||
|
|
@ -78,8 +78,6 @@ const page = (props: any) => {
|
|||
getInitData();
|
||||
}, []);
|
||||
|
||||
let componentMounted = true;
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
title: Yup.string().required("Judul tidak boleh kosong"),
|
||||
});
|
||||
|
|
@ -288,12 +286,11 @@ const page = (props: any) => {
|
|||
<div className="font-semibold mb-3">
|
||||
<label htmlFor="description">Deskripsi Artikel</label>
|
||||
</div>
|
||||
{/* <JoditEditor value={content?.metaDescription} key={articleBody.id} onChange={(event: any) => setArticleBody(event.editor?.getData())} /> */}
|
||||
{/* <JoditEditor ref={editor} value={field.value} className="dark:text-black" onChange={field.onChange} /> */}
|
||||
{articleBody === null || articleBody === "" ? <div className="w-full px-0 text-sm">Deskripsi tidak boleh kosong</div> : ""}
|
||||
</div>
|
||||
</>
|
||||
{/* )} */}
|
||||
{/* )} */}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -154,9 +154,6 @@ const page = () => {
|
|||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
{/* <Button className="bg-purple-500 text-white" type="submit">
|
||||
Batal
|
||||
</Button> */}
|
||||
<Button className="bg-red-500 text-white" type="submit" onClick={() => onSubmit()}>
|
||||
Kirim
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -912,22 +912,7 @@ export default function FormImage() {
|
|||
)}
|
||||
<div className="">
|
||||
<Label>Deskripsi</Label>
|
||||
<Controller
|
||||
control={control}
|
||||
name="description"
|
||||
render={({ field: { onChange, value } }) => (
|
||||
// <JoditEditor
|
||||
// ref={editor}
|
||||
// value={articleBody || value}
|
||||
// onChange={onChange}
|
||||
// className="dark:text-black"
|
||||
// />
|
||||
<CustomEditor
|
||||
onChange={onChange}
|
||||
initialData={articleBody || value}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
ç
|
||||
{errors.description?.message && (
|
||||
<p className="text-red-400 text-sm">
|
||||
{errors.description.message}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,10 @@ import Cookies from "js-cookie";
|
|||
import { getInfoProfile } from "@/service/auth";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useRouter } from "@/i18n/routing";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import LocalSwitcher from "../partials/header/locale-switcher";
|
||||
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
|
||||
import { listRole } from "@/service/landing/landing";
|
||||
|
||||
type Detail = {
|
||||
id: number;
|
||||
|
|
@ -45,6 +48,12 @@ const Navbar = () => {
|
|||
const [search, setSearch] = useState("");
|
||||
const [onSearch, setOnSearch] = useState("");
|
||||
const pathname = usePathname();
|
||||
const [role, setRole] = useState<any>();
|
||||
const [menuActive, setMenuActive] = useState<string>();
|
||||
const [category, setCategory] = useState<any>();
|
||||
|
||||
let active = "";
|
||||
let menu = "";
|
||||
|
||||
const onLogout = () => {
|
||||
Object.keys(Cookies.get()).forEach((cookieName) => {
|
||||
|
|
@ -77,6 +86,39 @@ const Navbar = () => {
|
|||
initState();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
async function initState() {
|
||||
setMenuActive(menu);
|
||||
const res = await listRole();
|
||||
setRole(res?.data?.data);
|
||||
}
|
||||
|
||||
// async function getNotif() {
|
||||
// if (roleId != undefined) {
|
||||
// const response = await getUserNotifications(0, 2);
|
||||
// setNotifications(response?.data?.data?.content);
|
||||
// console.log("respon:", response);
|
||||
// }
|
||||
// }
|
||||
|
||||
// async function getNotifUpdate() {
|
||||
// if (roleId != undefined) {
|
||||
// const response = await getUserNotifications(0, 3);
|
||||
// setNotificationsUpdate(response?.data?.data?.content); // console.log("respon:", response);
|
||||
// }
|
||||
// }
|
||||
|
||||
// async function getPolritvStatus() {
|
||||
// const response = await getYtPolritvStatus();
|
||||
// console.log("Polritv status :", response?.data?.message);
|
||||
// setIsPolriTvOnline(response.data?.message == "Online");
|
||||
// }
|
||||
|
||||
initState();
|
||||
// getNotif();
|
||||
// getNotifUpdate();
|
||||
}, []);
|
||||
|
||||
const handleChange = (e: any) => {
|
||||
setSearch(e.target.value);
|
||||
};
|
||||
|
|
@ -396,12 +438,36 @@ const Navbar = () => {
|
|||
) : (
|
||||
// Masuk and Daftar buttons for roleId === null
|
||||
<div className="flex justify-center items-center mx-3 gap-5">
|
||||
<Link href="/auth" className="w-full lg:w-max px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700 text-center">
|
||||
<Link href="/auth" className="w-full lg:w-max px-4 py-[10px] bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700 text-center">
|
||||
{t("logIn")}
|
||||
</Link>
|
||||
<Link href="#" className="w-full lg:w-fit px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-[#bb3523] text-center hover:text-white">
|
||||
{t("register")}
|
||||
</Link>
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button className="w-full lg:w-max px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700 text-center">{t("register")}</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent size="sm" className="sm:max-w-[425px]">
|
||||
<div className="flex flex-col w-full gap-1">
|
||||
<p className="text-lg font-semibold text-center">Kategori Registrasi</p>
|
||||
<p className="text-base text-center">Silahkan pilih salah satu</p>
|
||||
</div>
|
||||
<div>
|
||||
{role?.map((row: any) => (
|
||||
<div key={row.id}>
|
||||
<input type="radio" id={`category${row.id}`} name="category" className="" value={row.id} checked={category == `${row.id}`} onChange={(event) => setCategory(event.target.value)} />
|
||||
<label className="ml-2" htmlFor={`category${row.id}`}>
|
||||
{row.name}
|
||||
</label>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="border-b-2 border-black"></div>
|
||||
<DialogFooter>
|
||||
<Link href={`/auth/registration?category=${category}`} className="bg-red-500 px-4 py-1 rounded-md border border-black text-white" type="submit">
|
||||
Selanjutnya{" "}
|
||||
</Link>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -570,12 +636,36 @@ const Navbar = () => {
|
|||
</>
|
||||
) : (
|
||||
<>
|
||||
<Link href="/auth" className="px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-[#bb3523]">
|
||||
<Link href="/auth" className="px-4 py-[10px] bg-[#bb3523] text-white font-semibold rounded-md hover:bg-[#bb3523]">
|
||||
{t("logIn")}
|
||||
</Link>
|
||||
<Link href="#" className="px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-[#bb3523] hover:text-white">
|
||||
{t("register")}
|
||||
</Link>{" "}
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button className="w-full lg:w-max px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700 text-center">{t("register")}</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent size="sm" className="sm:max-w-[425px]">
|
||||
<div className="flex flex-col w-full gap-1">
|
||||
<p className="text-lg font-semibold text-center">Kategori Registrasi</p>
|
||||
<p className="text-base text-center">Silahkan pilih salah satu</p>
|
||||
</div>
|
||||
<div>
|
||||
{role?.map((row: any) => (
|
||||
<div key={row.id}>
|
||||
<input type="radio" id={`category${row.id}`} name="category" className="" value={row.id} checked={category == `${row.id}`} onChange={(event) => setCategory(event.target.value)} />
|
||||
<label className="ml-2" htmlFor={`category${row.id}`}>
|
||||
{row.name}
|
||||
</label>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="border-b-2 border-black"></div>
|
||||
<DialogFooter>
|
||||
<Link href={`/auth/registration?category=${category}`} className="bg-red-500 px-4 py-1 rounded-md border border-black text-white" type="submit">
|
||||
Selanjutnya{" "}
|
||||
</Link>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ const SidebarManagement = () => {
|
|||
|
||||
<div className="p-4">
|
||||
<Link href="/content-management/galery" className="mb-3">
|
||||
<div className={`${pathname?.includes("/content-management/galery") ? "bg-slate-500 text-white" : ""} hover:bg-slate-600 cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className={`${pathname?.includes("/content-management/galery") ? "bg-slate-500 text-white" : ""} hover:bg-slate-500 hover:text-white cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className="flex items-center gap-2 text-lg">
|
||||
<Icon icon="material-symbols-light:perm-media-rounded" />
|
||||
<p className="text-sm">Galeri {profile?.institute?.name}</p>
|
||||
|
|
@ -107,7 +107,7 @@ const SidebarManagement = () => {
|
|||
</div>
|
||||
</Link>
|
||||
<Link href="/content-management/download" className="mb-3">
|
||||
<div className={`${pathname?.includes("/content-management/download") ? "bg-slate-500 text-white" : ""} hover:bg-slate-600 cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className={`${pathname?.includes("/content-management/download") ? "bg-slate-500 text-white" : ""} hover:bg-slate-500 hover:text-white cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className="flex items-center gap-2 text-lg">
|
||||
<Icon icon="heroicons:photo-solid" />
|
||||
<p className="text-sm">Galeri Saya</p>
|
||||
|
|
@ -118,7 +118,7 @@ const SidebarManagement = () => {
|
|||
</div>
|
||||
</Link>
|
||||
<Link href="/content-management/rewrite" className="mb-3">
|
||||
<div className={`${pathname?.includes("/content-management/rewrite") ? "bg-slate-500 text-white" : ""} hover:bg-slate-600 cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className={`${pathname?.includes("/content-management/rewrite") ? "bg-slate-500 text-white" : ""} hover:bg-slate-500 hover:text-white cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className="flex items-center gap-2 text-lg">
|
||||
<Icon icon="material-symbols-light:perm-media-rounded" />
|
||||
<p className="text-sm">Galeri Rewrite</p>
|
||||
|
|
@ -129,7 +129,7 @@ const SidebarManagement = () => {
|
|||
</div>
|
||||
</Link>
|
||||
<Link href="/content-management/users" className="mb-3">
|
||||
<div className={`${pathname?.includes("/content-management/users") ? "bg-slate-500 text-white" : ""} hover:bg-slate-600 cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className={`${pathname?.includes("/content-management/users") ? "bg-slate-500 text-white" : ""} hover:bg-slate-500 hover:text-white cursor-pointer p-4 rounded-lg flex justify-between`}>
|
||||
<div className="flex items-center gap-2 text-lg">
|
||||
<Icon icon="mdi:users-group" />
|
||||
<p className="text-sm">Tim Pengguna</p>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,16 @@
|
|||
import {
|
||||
httpDeleteInterceptor,
|
||||
httpGetInterceptor,
|
||||
httpPostInterceptor,
|
||||
} from "../http-config/http-interceptor-service";
|
||||
import { httpDeleteInterceptor, httpGetInterceptor, httpPostInterceptor } from "../http-config/http-interceptor-service";
|
||||
|
||||
export async function getHeroData() {
|
||||
return await httpGetInterceptor(
|
||||
`media/public/list?enablePage=1&sort=desc&sortBy=createdAt&size=5&page=0&typeId=1&title=&categoryId=&fileFormats=&tags=&group=&startDate=&endDate=&month=&year=`
|
||||
);
|
||||
return await httpGetInterceptor(`media/public/list?enablePage=1&sort=desc&sortBy=createdAt&size=5&page=0&typeId=1&title=&categoryId=&fileFormats=&tags=&group=&startDate=&endDate=&month=&year=`);
|
||||
}
|
||||
|
||||
export async function getCategoryData() {
|
||||
return await httpGetInterceptor(
|
||||
`media/categories/list/publish?enablePage=1&sort=desc&sortBy=updatedAt&size=12&type=`
|
||||
);
|
||||
return await httpGetInterceptor(`media/categories/list/publish?enablePage=1&sort=desc&sortBy=updatedAt&size=12&type=`);
|
||||
}
|
||||
|
||||
export async function getListContent(props: any) {
|
||||
return await httpGetInterceptor(
|
||||
`media/public/list?enablePage=1&sort=desc&sortBy=${props.sortBy}&size=${
|
||||
props.size
|
||||
}&page=${props.page}&typeId=${props.contentTypeId}&title=${
|
||||
`media/public/list?enablePage=1&sort=desc&sortBy=${props.sortBy}&size=${props.size}&page=${props.page}&typeId=${props.contentTypeId}&title=${
|
||||
props.title ? props.title : ""
|
||||
}&categoryId=&fileFormats=&tags=&group=&startDate=&endDate=&month=&year=`
|
||||
);
|
||||
|
|
@ -31,9 +21,7 @@ export async function getPrivacy() {
|
|||
}
|
||||
|
||||
export async function getIndeksData() {
|
||||
return await httpGetInterceptor(
|
||||
`blog/public/pagination?enablePage=1&page=0&size=20`
|
||||
);
|
||||
return await httpGetInterceptor(`blog/public/pagination?enablePage=1&page=0&size=20`);
|
||||
}
|
||||
|
||||
export async function getDetail(slug: string) {
|
||||
|
|
@ -41,9 +29,7 @@ export async function getDetail(slug: string) {
|
|||
}
|
||||
|
||||
export async function getDetailIndeks() {
|
||||
return await httpGetInterceptor(
|
||||
`blog/public/pagination?enablePage=1&page=0&size=6`
|
||||
);
|
||||
return await httpGetInterceptor(`blog/public/pagination?enablePage=1&page=0&size=6`);
|
||||
}
|
||||
|
||||
export async function getFeedback() {
|
||||
|
|
@ -55,49 +41,20 @@ export async function postUserFeedback() {
|
|||
}
|
||||
|
||||
export async function listCategory(type = "") {
|
||||
return await httpGetInterceptor(
|
||||
`media/categories/list/enable?enablePage=1&sort=desc&sortBy=updatedAt&size=12&type=${type}`
|
||||
);
|
||||
return await httpGetInterceptor(`media/categories/list/enable?enablePage=1&sort=desc&sortBy=updatedAt&size=12&type=${type}`);
|
||||
}
|
||||
|
||||
export async function publicDetailBlog(slug: any) {
|
||||
return await httpGetInterceptor(`blog/public/read/${slug}`);
|
||||
}
|
||||
|
||||
export async function listData(
|
||||
type: string,
|
||||
search: string,
|
||||
category: string,
|
||||
size = 10,
|
||||
page = 0,
|
||||
sortBy = "createdAt",
|
||||
format = "",
|
||||
tag = "",
|
||||
group = "",
|
||||
startDate = "",
|
||||
endDate = "",
|
||||
month = "",
|
||||
year = ""
|
||||
) {
|
||||
export async function listData(type: string, search: string, category: string, size = 10, page = 0, sortBy = "createdAt", format = "", tag = "", group = "", startDate = "", endDate = "", month = "", year = "") {
|
||||
return await httpGetInterceptor(
|
||||
`media/public/list?enablePage=1&sort=desc&sortBy=${sortBy}&size=${size}&page=${page}&typeId=${type}&title=${search}&categoryId=${category}&fileFormats=${format}&tags=${tag}&group=${group}&startDate=${startDate}&endDate=${endDate}&month=${month}&year=${year}`
|
||||
);
|
||||
}
|
||||
|
||||
export async function listDataRegional(
|
||||
type: string,
|
||||
search: string,
|
||||
category: string,
|
||||
format = "",
|
||||
tag = "",
|
||||
startDate = "",
|
||||
endDate = "",
|
||||
month = "",
|
||||
year = "",
|
||||
size = 10,
|
||||
page = 0,
|
||||
sortBy = "createdAt"
|
||||
) {
|
||||
export async function listDataRegional(type: string, search: string, category: string, format = "", tag = "", startDate = "", endDate = "", month = "", year = "", size = 10, page = 0, sortBy = "createdAt") {
|
||||
return await httpGetInterceptor(
|
||||
`media/public/regional-list?enablePage=1&size=${size}&page=${page}&sort=desc&sortBy=${sortBy}&typeId=${type}&title=${search}&categoryId=${category}&fileFormats=${format}&tags=${tag}&startDate=${startDate}&endDate=${endDate}&month=${month}&year=${year}`
|
||||
);
|
||||
|
|
@ -118,51 +75,32 @@ export async function getListPorvinces() {
|
|||
export async function getUsersTeams(id: any) {
|
||||
return await httpGetInterceptor(`users?instituteId=${id}`);
|
||||
}
|
||||
export async function mediaWishlist(
|
||||
type: any,
|
||||
instituteId: any,
|
||||
search: any,
|
||||
category: any,
|
||||
size: string,
|
||||
page: number,
|
||||
sortBy: undefined,
|
||||
format: string
|
||||
) {
|
||||
return await httpGetInterceptor(
|
||||
`/media/wishlist/list?enablePage=1&size=${size}&page=${page}&typeId=${type}&instituteId=${instituteId}`
|
||||
);
|
||||
export async function mediaWishlist(type: any, instituteId: any, search: any, category: any, size: string, page: number, sortBy: undefined, format: string) {
|
||||
return await httpGetInterceptor(`/media/wishlist/list?enablePage=1&size=${size}&page=${page}&typeId=${type}&instituteId=${instituteId}`);
|
||||
}
|
||||
|
||||
export async function checkWishlistStatus(mediaId: any) {
|
||||
return await httpGetInterceptor(`/media/wishlist/status?mediaId=${mediaId}`);
|
||||
}
|
||||
|
||||
export async function listRole() {
|
||||
const url = "public/users/roles";
|
||||
return httpGetInterceptor(url);
|
||||
}
|
||||
|
||||
export async function deleteWishlist(id: any) {
|
||||
return await httpDeleteInterceptor(`media/wishlist?id=${id}`);
|
||||
}
|
||||
|
||||
export async function getContentRewritePagination(page = 0, size = 10) {
|
||||
return await httpGetInterceptor(
|
||||
`media/rewrite/pagination?size=${size}&page=${page}`
|
||||
);
|
||||
return await httpGetInterceptor(`media/rewrite/pagination?size=${size}&page=${page}`);
|
||||
}
|
||||
|
||||
export async function getContentRewrite(id: any) {
|
||||
return await httpGetInterceptor(`media/rewrite?id=${id}`);
|
||||
}
|
||||
|
||||
export async function listDataAll(
|
||||
type: any,
|
||||
search: any,
|
||||
category: any,
|
||||
format = "",
|
||||
tag = "",
|
||||
group = "",
|
||||
startDate = "",
|
||||
endDate = "",
|
||||
month = "",
|
||||
year = ""
|
||||
) {
|
||||
export async function listDataAll(type: any, search: any, category: any, format = "", tag = "", group = "", startDate = "", endDate = "", month = "", year = "") {
|
||||
return await httpGetInterceptor(
|
||||
`media/public/list?enablePage=1&size=20&sort=desc&typeId=${type}&title=${search}&categoryId=${category}&fileFormats=${format}&tags=${tag}&group=${group}&startDate=${startDate}&endDate=${endDate}&month=${month}&year=${year}`
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue