fix: input search all content and menu sidebar in polda and satker approver
This commit is contained in:
commit
4605ef3aeb
|
|
@ -289,7 +289,17 @@ export default function CreateUserForm() {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (data.role == "OPT-ID") {
|
if (data.role == "OPT-ID") {
|
||||||
req.handledSocialMedia = data?.sns ? data.sns.join(",") : "";
|
// req.handledSocialMedia = data?.sns ? data.sns.join(",") : "";
|
||||||
|
if (data.role == "OPT-ID") {
|
||||||
|
let snsValue = data?.sns ? data.sns.join(",") : "";
|
||||||
|
|
||||||
|
// ✅ Jika hanya 1 value → tambahkan koma agar backend tidak error
|
||||||
|
if (data?.sns && data.sns.length === 1) {
|
||||||
|
snsValue = snsValue + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
req.handledSocialMedia = snsValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.role == "KUR-ID") {
|
if (data.role == "KUR-ID") {
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ const TableAudio = () => {
|
||||||
const [showData, setShowData] = React.useState("10");
|
const [showData, setShowData] = React.useState("10");
|
||||||
const [page, setPage] = React.useState(1);
|
const [page, setPage] = React.useState(1);
|
||||||
const [search, setSearch] = React.useState("");
|
const [search, setSearch] = React.useState("");
|
||||||
const searchTimeout = React.useRef<NodeJS.Timeout | null>(null);
|
const [searchTimeout, setSearchTimeout] = React.useState<any>(null);
|
||||||
const [categories, setCategories] = React.useState<any[]>([]);
|
const [categories, setCategories] = React.useState<any[]>([]);
|
||||||
const [selectedCategories, setSelectedCategories] = React.useState<number[]>(
|
const [selectedCategories, setSelectedCategories] = React.useState<number[]>(
|
||||||
[]
|
[]
|
||||||
|
|
@ -121,7 +121,7 @@ const TableAudio = () => {
|
||||||
filterByCreator,
|
filterByCreator,
|
||||||
filterBySource,
|
filterBySource,
|
||||||
filterByCreatorGroup,
|
filterByCreatorGroup,
|
||||||
search,
|
// search,
|
||||||
showData,
|
showData,
|
||||||
page,
|
page,
|
||||||
]);
|
]);
|
||||||
|
|
@ -183,14 +183,30 @@ const TableAudio = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ Debounced search
|
// const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
// const value = e.target.value;
|
||||||
|
// setSearch(value);
|
||||||
|
// if (searchTimeout.current) clearTimeout(searchTimeout.current);
|
||||||
|
// searchTimeout.current = setTimeout(() => {
|
||||||
|
// fetchData(true, value);
|
||||||
|
// }, 500);
|
||||||
|
// };
|
||||||
|
|
||||||
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
setSearch(value);
|
setSearch(value);
|
||||||
if (searchTimeout.current) clearTimeout(searchTimeout.current);
|
|
||||||
searchTimeout.current = setTimeout(() => {
|
// Hapus timer lama
|
||||||
|
if (searchTimeout) {
|
||||||
|
clearTimeout(searchTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set timer baru untuk 3 detik
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
fetchData(true, value);
|
fetchData(true, value);
|
||||||
}, 500);
|
}, 2000);
|
||||||
|
|
||||||
|
setSearchTimeout(timeout);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSearchFilterBySource = (
|
const handleSearchFilterBySource = (
|
||||||
|
|
@ -249,15 +265,15 @@ const TableAudio = () => {
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
<div className="flex flex-col md:flex-row md:justify-between items-center md:px-5">
|
<div className="flex flex-col md:flex-row md:justify-between items-center md:px-5">
|
||||||
{/* 🔍 Search bar */}
|
{/* 🔍 Search bar */}
|
||||||
<div className="w-full md:w-[250px] px-2">
|
<div className="w-full md:w-[200px] lg:w-[300px] px-2">
|
||||||
<InputGroup merged>
|
<InputGroup merged>
|
||||||
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
<Search className="h-4 w-4 dark:text-white" />
|
<Search className="h-6 w-6 dark:text-white" />
|
||||||
</InputGroupText>
|
</InputGroupText>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Cari Judul..."
|
placeholder="Cari Judul..."
|
||||||
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white text-[16px]"
|
||||||
value={search}
|
value={search}
|
||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ const TableImage = () => {
|
||||||
const [showData, setShowData] = React.useState("10");
|
const [showData, setShowData] = React.useState("10");
|
||||||
const [page, setPage] = React.useState(1);
|
const [page, setPage] = React.useState(1);
|
||||||
const [search, setSearch] = React.useState("");
|
const [search, setSearch] = React.useState("");
|
||||||
|
const [searchTimeout, setSearchTimeout] = React.useState<any>(null);
|
||||||
|
|
||||||
// === FILTER STATES ===
|
// === FILTER STATES ===
|
||||||
const [categories, setCategories] = React.useState<any[]>([]);
|
const [categories, setCategories] = React.useState<any[]>([]);
|
||||||
|
|
@ -120,7 +121,7 @@ const TableImage = () => {
|
||||||
filterByCreator,
|
filterByCreator,
|
||||||
filterBySource,
|
filterBySource,
|
||||||
filterByCreatorGroup,
|
filterByCreatorGroup,
|
||||||
search,
|
// search,
|
||||||
showData,
|
showData,
|
||||||
page,
|
page,
|
||||||
]);
|
]);
|
||||||
|
|
@ -209,10 +210,27 @@ const TableImage = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// const handleSearch: any = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
// const value = e.target.value;
|
||||||
|
// setSearch(value);
|
||||||
|
// fetchData(true, value);
|
||||||
|
// };
|
||||||
|
|
||||||
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
setSearch(value);
|
setSearch(value);
|
||||||
|
|
||||||
|
// Hapus timer lama
|
||||||
|
if (searchTimeout) {
|
||||||
|
clearTimeout(searchTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set timer baru untuk 3 detik
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
fetchData(true, value);
|
fetchData(true, value);
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
|
setSearchTimeout(timeout);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSearchFilterByCreator = (
|
const handleSearchFilterByCreator = (
|
||||||
|
|
@ -247,15 +265,15 @@ const TableImage = () => {
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
{/* 🔍 FILTER & SEARCH BAR */}
|
{/* 🔍 FILTER & SEARCH BAR */}
|
||||||
<div className="flex flex-col md:flex-row lg:flex-row md:justify-between lg:justify-between items-center md:px-5 lg:px-5">
|
<div className="flex flex-col md:flex-row lg:flex-row md:justify-between lg:justify-between items-center md:px-5 lg:px-5">
|
||||||
<div className="w-full md:w-[200px] lg:w-[200px] px-2">
|
<div className="w-full md:w-[200px] lg:w-[300px] px-2">
|
||||||
<InputGroup merged>
|
<InputGroup merged>
|
||||||
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
<Search className="h-4 w-4 dark:text-white" />
|
<Search className="h-6 w-6 dark:text-white" />
|
||||||
</InputGroupText>
|
</InputGroupText>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Cari Judul..."
|
placeholder="Cari Judul..."
|
||||||
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white text-[16px]"
|
||||||
value={search}
|
value={search}
|
||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -247,15 +247,15 @@ const TableSPIT = () => {
|
||||||
return (
|
return (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex justify-between items-center px-5">
|
<div className="flex justify-between items-center px-5">
|
||||||
<div className="w-[150px] md:w-[250px] lg:w-[250px]">
|
<div className="w-[150px] md:w-[250px] lg:w-[300px]">
|
||||||
<InputGroup merged>
|
<InputGroup merged>
|
||||||
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
<Search className=" h-4 w-4 dark:text-white" />
|
<Search className=" h-6 w-6 dark:text-white" />
|
||||||
</InputGroupText>
|
</InputGroupText>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search Judul..."
|
placeholder="Search Judul..."
|
||||||
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white text-[16px]"
|
||||||
value={search}
|
value={search}
|
||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ const TableTeks = () => {
|
||||||
const [showData, setShowData] = React.useState("10");
|
const [showData, setShowData] = React.useState("10");
|
||||||
const [page, setPage] = React.useState(1);
|
const [page, setPage] = React.useState(1);
|
||||||
const [search, setSearch] = React.useState("");
|
const [search, setSearch] = React.useState("");
|
||||||
const searchTimeout = React.useRef<NodeJS.Timeout | null>(null);
|
const [searchTimeout, setSearchTimeout] = React.useState<any>(null);
|
||||||
|
|
||||||
// === FILTER STATES ===
|
// === FILTER STATES ===
|
||||||
const [categories, setCategories] = React.useState<any[]>([]);
|
const [categories, setCategories] = React.useState<any[]>([]);
|
||||||
|
|
@ -125,7 +125,7 @@ const TableTeks = () => {
|
||||||
filterByCreator,
|
filterByCreator,
|
||||||
filterBySource,
|
filterBySource,
|
||||||
filterByCreatorGroup,
|
filterByCreatorGroup,
|
||||||
search,
|
// search,
|
||||||
showData,
|
showData,
|
||||||
page,
|
page,
|
||||||
]);
|
]);
|
||||||
|
|
@ -187,14 +187,30 @@ const TableTeks = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ Debounced search
|
// const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
// const value = e.target.value;
|
||||||
|
// setSearch(value);
|
||||||
|
// if (searchTimeout.current) clearTimeout(searchTimeout.current);
|
||||||
|
// searchTimeout.current = setTimeout(() => {
|
||||||
|
// fetchData(true, value);
|
||||||
|
// }, 500);
|
||||||
|
// };
|
||||||
|
|
||||||
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
setSearch(value);
|
setSearch(value);
|
||||||
if (searchTimeout.current) clearTimeout(searchTimeout.current);
|
|
||||||
searchTimeout.current = setTimeout(() => {
|
// Hapus timer lama
|
||||||
|
if (searchTimeout) {
|
||||||
|
clearTimeout(searchTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set timer baru untuk 3 detik
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
fetchData(true, value);
|
fetchData(true, value);
|
||||||
}, 500);
|
}, 2000);
|
||||||
|
|
||||||
|
setSearchTimeout(timeout);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSearchFilterBySource = (
|
const handleSearchFilterBySource = (
|
||||||
|
|
@ -253,15 +269,15 @@ const TableTeks = () => {
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
<div className="flex flex-col md:flex-row md:justify-between items-center md:px-5">
|
<div className="flex flex-col md:flex-row md:justify-between items-center md:px-5">
|
||||||
{/* 🔍 Search bar */}
|
{/* 🔍 Search bar */}
|
||||||
<div className="w-full md:w-[250px] px-2">
|
<div className="w-full md:w-[200px] lg:w-[300px] px-2">
|
||||||
<InputGroup merged>
|
<InputGroup merged>
|
||||||
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
<Search className="h-4 w-4 dark:text-white" />
|
<Search className="h-6 w-6 dark:text-white" />
|
||||||
</InputGroupText>
|
</InputGroupText>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Cari Judul..."
|
placeholder="Cari Judul..."
|
||||||
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white text-[16px]"
|
||||||
value={search}
|
value={search}
|
||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ const TableVideo = () => {
|
||||||
const [showData, setShowData] = React.useState("10");
|
const [showData, setShowData] = React.useState("10");
|
||||||
const [page, setPage] = React.useState(1);
|
const [page, setPage] = React.useState(1);
|
||||||
const [search, setSearch] = React.useState("");
|
const [search, setSearch] = React.useState("");
|
||||||
const searchTimeout = React.useRef<NodeJS.Timeout | null>(null);
|
const [searchTimeout, setSearchTimeout] = React.useState<any>(null);
|
||||||
|
|
||||||
// === FILTER STATES ===
|
// === FILTER STATES ===
|
||||||
const [categories, setCategories] = React.useState<any[]>([]);
|
const [categories, setCategories] = React.useState<any[]>([]);
|
||||||
|
|
@ -126,7 +126,7 @@ const TableVideo = () => {
|
||||||
filterByCreator,
|
filterByCreator,
|
||||||
filterBySource,
|
filterBySource,
|
||||||
filterByCreatorGroup,
|
filterByCreatorGroup,
|
||||||
search,
|
// search,
|
||||||
showData,
|
showData,
|
||||||
page,
|
page,
|
||||||
]);
|
]);
|
||||||
|
|
@ -214,15 +214,33 @@ const TableVideo = () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
// const value = e.target.value;
|
||||||
|
// setSearch(value);
|
||||||
|
// if (searchTimeout.current) clearTimeout(searchTimeout.current);
|
||||||
|
// searchTimeout.current = setTimeout(() => {
|
||||||
|
// fetchData(true, value);
|
||||||
|
// }, 500);
|
||||||
|
// };
|
||||||
|
|
||||||
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
setSearch(value);
|
setSearch(value);
|
||||||
if (searchTimeout.current) clearTimeout(searchTimeout.current);
|
|
||||||
searchTimeout.current = setTimeout(() => {
|
// Hapus timer lama
|
||||||
|
if (searchTimeout) {
|
||||||
|
clearTimeout(searchTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set timer baru untuk 3 detik
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
fetchData(true, value);
|
fetchData(true, value);
|
||||||
}, 500);
|
}, 2000);
|
||||||
|
|
||||||
|
setSearchTimeout(timeout);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleSearchFilterByCreator = (
|
const handleSearchFilterByCreator = (
|
||||||
e: React.ChangeEvent<HTMLInputElement>
|
e: React.ChangeEvent<HTMLInputElement>
|
||||||
) => {
|
) => {
|
||||||
|
|
@ -257,15 +275,15 @@ const TableVideo = () => {
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
<div className="flex flex-col md:flex-row md:justify-between items-center md:px-5">
|
<div className="flex flex-col md:flex-row md:justify-between items-center md:px-5">
|
||||||
{/* 🔍 Search bar */}
|
{/* 🔍 Search bar */}
|
||||||
<div className="w-full md:w-[250px] px-2">
|
<div className="w-full md:w-[200px] lg:w-[300px] px-2">
|
||||||
<InputGroup merged>
|
<InputGroup merged>
|
||||||
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
<Search className="h-4 w-4 dark:text-white" />
|
<Search className="h-6 w-6 dark:text-white" />
|
||||||
</InputGroupText>
|
</InputGroupText>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Cari Judul..."
|
placeholder="Cari Judul..."
|
||||||
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white text-[16px]"
|
||||||
value={search}
|
value={search}
|
||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -19,6 +19,8 @@ import { Skeleton } from "../ui/skeleton";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import ImageBlurry from "../ui/image-blurry";
|
import ImageBlurry from "../ui/image-blurry";
|
||||||
|
import { formatDateToIndonesian } from "@/utils/globals";
|
||||||
|
import { Icon } from "../ui/icon";
|
||||||
|
|
||||||
const NewContent = (props: { group: string; type: string }) => {
|
const NewContent = (props: { group: string; type: string }) => {
|
||||||
const [newContent, setNewContent] = useState<any>();
|
const [newContent, setNewContent] = useState<any>();
|
||||||
|
|
@ -276,10 +278,24 @@ const NewContent = (props: { group: string; type: string }) => {
|
||||||
{/* Caption section */}
|
{/* Caption section */}
|
||||||
<div className="p-4 h-full flex flex-col justify-between">
|
<div className="p-4 h-full flex flex-col justify-between">
|
||||||
<div className="flex flex-col gap-1 flex-grow">
|
<div className="flex flex-col gap-1 flex-grow">
|
||||||
|
<div className="flex flex-row justify-between mb-2">
|
||||||
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
|
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
|
||||||
{image?.categoryName?.toUpperCase() ??
|
{image?.categoryName?.toUpperCase() ??
|
||||||
"Giat Pimpinan"}
|
"Giat Pimpinan"}
|
||||||
</p>
|
</p>
|
||||||
|
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
|
||||||
|
{formatDateToIndonesian(
|
||||||
|
new Date(image?.createdAt)
|
||||||
|
)}{" "}
|
||||||
|
{image?.timezone ?? "WIB"} |
|
||||||
|
<Icon
|
||||||
|
icon="formkit:eye"
|
||||||
|
width="15"
|
||||||
|
height="15"
|
||||||
|
/>{" "}
|
||||||
|
{image.clickCount}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
prefixPath + `/image/detail/${image?.slug}`
|
prefixPath + `/image/detail/${image?.slug}`
|
||||||
|
|
@ -366,12 +382,26 @@ const NewContent = (props: { group: string; type: string }) => {
|
||||||
|
|
||||||
{/* Caption */}
|
{/* Caption */}
|
||||||
<div className="p-4">
|
<div className="p-4">
|
||||||
<p className="text-[12px] font-bold text-[#bb3523] uppercase mb-1">
|
<div className="flex flex-row justify-between mb-2">
|
||||||
|
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
|
||||||
{audio?.categoryName?.toUpperCase() ??
|
{audio?.categoryName?.toUpperCase() ??
|
||||||
"GIAT PIMPINAN"}
|
"Giat Pimpinan"}
|
||||||
</p>
|
</p>
|
||||||
|
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
|
||||||
|
{formatDateToIndonesian(
|
||||||
|
new Date(audio?.createdAt)
|
||||||
|
)}{" "}
|
||||||
|
{audio?.timezone ?? "WIB"} |
|
||||||
|
<Icon
|
||||||
|
icon="formkit:eye"
|
||||||
|
width="15"
|
||||||
|
height="15"
|
||||||
|
/>{" "}
|
||||||
|
{audio.clickCount}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p className="text-xl font-semibold text-black dark:text-white line-clamp-4">
|
<p className="text-sm lg:text-base font-semibold text-black dark:text-white line-clamp-4">
|
||||||
{audio?.title}
|
{audio?.title}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -488,10 +518,25 @@ const NewContent = (props: { group: string; type: string }) => {
|
||||||
{/* Caption section */}
|
{/* Caption section */}
|
||||||
<div className="p-4 h-full flex flex-col justify-between">
|
<div className="p-4 h-full flex flex-col justify-between">
|
||||||
<div className="flex flex-col gap-1 flex-grow">
|
<div className="flex flex-col gap-1 flex-grow">
|
||||||
|
<div className="flex flex-row justify-between mb-2">
|
||||||
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
|
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
|
||||||
{video?.categoryName?.toUpperCase() ??
|
{video?.categoryName?.toUpperCase() ??
|
||||||
"Giat Pimpinan"}
|
"Giat Pimpinan"}
|
||||||
</p>
|
</p>
|
||||||
|
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
|
||||||
|
{formatDateToIndonesian(
|
||||||
|
new Date(video?.createdAt)
|
||||||
|
)}{" "}
|
||||||
|
{video?.timezone ?? "WIB"} |
|
||||||
|
<Icon
|
||||||
|
icon="formkit:eye"
|
||||||
|
width="15"
|
||||||
|
height="15"
|
||||||
|
/>{" "}
|
||||||
|
{video.clickCount}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
prefixPath + `/video/detail/${video?.slug}`
|
prefixPath + `/video/detail/${video?.slug}`
|
||||||
|
|
@ -581,8 +626,23 @@ const NewContent = (props: { group: string; type: string }) => {
|
||||||
{/* Konten bawah */}
|
{/* Konten bawah */}
|
||||||
<div className="p-4 flex flex-col gap-2">
|
<div className="p-4 flex flex-col gap-2">
|
||||||
{/* Kategori merah */}
|
{/* Kategori merah */}
|
||||||
<div className="text-[12px] font-bold text-red-600 uppercase">
|
<div className="flex flex-row justify-between mb-2">
|
||||||
{text?.categoryName?.toUpperCase() ?? "Text"}
|
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
|
||||||
|
{text?.categoryName?.toUpperCase() ??
|
||||||
|
"Giat Pimpinan"}
|
||||||
|
</p>
|
||||||
|
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
|
||||||
|
{formatDateToIndonesian(
|
||||||
|
new Date(text?.createdAt)
|
||||||
|
)}{" "}
|
||||||
|
{text?.timezone ?? "WIB"} |
|
||||||
|
<Icon
|
||||||
|
icon="formkit:eye"
|
||||||
|
width="15"
|
||||||
|
height="15"
|
||||||
|
/>{" "}
|
||||||
|
{text.clickCount}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Judul */}
|
{/* Judul */}
|
||||||
|
|
@ -591,7 +651,7 @@ const NewContent = (props: { group: string; type: string }) => {
|
||||||
prefixPath + `/document/detail/${text?.slug}`
|
prefixPath + `/document/detail/${text?.slug}`
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<p className="font-semibold text-gray-900 dark:text-white text-xl leading-snug line-clamp-4">
|
<p className="font-semibold text-gray-900 dark:text-white text-sm lg:text-base leading-snug line-clamp-4">
|
||||||
{text?.title}
|
{text?.title}
|
||||||
</p>
|
</p>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
270
lib/menus.ts
270
lib/menus.ts
|
|
@ -2642,9 +2642,8 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
(Number(roleId) == 3 || Number(roleId) == 14 || Number(roleId) == 15) &&
|
(Number(roleId) == 3 || Number(roleId) == 14 || Number(roleId) == 15) &&
|
||||||
Number(levelNumber) == 3
|
Number(levelNumber) == 3
|
||||||
) {
|
) {
|
||||||
const hideForRole3 = Number(roleId) === 3;
|
if (Number(userParentLevelId) != 761)
|
||||||
|
{
|
||||||
if (Number(userParentLevelId) != 771) {
|
|
||||||
menusSelected = [
|
menusSelected = [
|
||||||
{
|
{
|
||||||
groupLabel: t("apps"),
|
groupLabel: t("apps"),
|
||||||
|
|
@ -2699,17 +2698,15 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
icon: "heroicons:share",
|
icon: "heroicons:share",
|
||||||
children: [],
|
children: [],
|
||||||
},
|
},
|
||||||
...(!hideForRole3
|
|
||||||
? [
|
// {
|
||||||
{
|
// href: "/contributor/content/spit",
|
||||||
href: "/contributor/content/spit",
|
// label: "spit",
|
||||||
label: "spit",
|
// active: pathname.includes("/content/spit"),
|
||||||
active: pathname.includes("/content/spit"),
|
// icon: "heroicons:credit-card",
|
||||||
icon: "heroicons:credit-card",
|
// children: [],
|
||||||
children: [],
|
// },
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
// {
|
// {
|
||||||
// href: "/contributor/content/nulis-ai",
|
// href: "/contributor/content/nulis-ai",
|
||||||
// label: "nulis ai",
|
// label: "nulis ai",
|
||||||
|
|
@ -2735,39 +2732,36 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
...(!hideForRole3
|
// {
|
||||||
? [
|
// groupLabel: "",
|
||||||
{
|
// id: "planning",
|
||||||
groupLabel: "",
|
// menus: [
|
||||||
id: "planning",
|
// {
|
||||||
menus: [
|
// id: "planning",
|
||||||
{
|
// href: "/contributor/planning",
|
||||||
id: "planning",
|
// label: t("planning"),
|
||||||
href: "/contributor/planning",
|
// active: pathname.includes("/planning"),
|
||||||
label: t("planning"),
|
// icon: "pajamas:planning",
|
||||||
active: pathname.includes("/planning"),
|
// submenus: [
|
||||||
icon: "pajamas:planning",
|
// {
|
||||||
submenus: [
|
// href: "/contributor/planning/mediahub",
|
||||||
{
|
// label: "mediaHub",
|
||||||
href: "/contributor/planning/mediahub",
|
// active: pathname.includes("/planning/mediahub"),
|
||||||
label: "mediaHub",
|
// icon: "heroicons:arrow-trending-up",
|
||||||
active: pathname.includes("/planning/mediahub"),
|
// children: [],
|
||||||
icon: "heroicons:arrow-trending-up",
|
// },
|
||||||
children: [],
|
// {
|
||||||
},
|
// href: "/contributor/planning/medsos-mediahub",
|
||||||
{
|
// label: "medsos mediahub",
|
||||||
href: "/contributor/planning/medsos-mediahub",
|
// active: pathname.includes("/planning/medsos-mediahub"),
|
||||||
label: "medsos mediahub",
|
// icon: "heroicons:shopping-cart",
|
||||||
active: pathname.includes("/planning/medsos-mediahub"),
|
// children: [],
|
||||||
icon: "heroicons:shopping-cart",
|
// },
|
||||||
children: [],
|
// ],
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
groupLabel: "",
|
groupLabel: "",
|
||||||
id: "task",
|
id: "task",
|
||||||
|
|
@ -2818,24 +2812,21 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
...(!hideForRole3
|
|
||||||
? [
|
// {
|
||||||
{
|
// groupLabel: "",
|
||||||
groupLabel: "",
|
// id: "blog",
|
||||||
id: "blog",
|
// menus: [
|
||||||
menus: [
|
// {
|
||||||
{
|
// id: "blog",
|
||||||
id: "blog",
|
// href: "/contributor/blog",
|
||||||
href: "/contributor/blog",
|
// label: t("blog"),
|
||||||
label: t("blog"),
|
// active: pathname.includes("/blog"),
|
||||||
active: pathname.includes("/blog"),
|
// icon: "fluent:clipboard-text-32-regular",
|
||||||
icon: "fluent:clipboard-text-32-regular",
|
// submenus: [],
|
||||||
submenus: [],
|
// },
|
||||||
},
|
// ],
|
||||||
],
|
// },
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
groupLabel: "",
|
groupLabel: "",
|
||||||
id: "curatedcontent",
|
id: "curatedcontent",
|
||||||
|
|
@ -2878,46 +2869,43 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
...(!hideForRole3
|
|
||||||
? [
|
// {
|
||||||
{
|
// groupLabel: "",
|
||||||
groupLabel: "",
|
// id: "settings",
|
||||||
id: "settings",
|
// menus: [
|
||||||
menus: [
|
// {
|
||||||
{
|
// id: "settings",
|
||||||
id: "settings",
|
// href: "/admin/settings",
|
||||||
href: "/admin/settings",
|
// label: t("settings"),
|
||||||
label: t("settings"),
|
// active: pathname.includes("/settinng"),
|
||||||
active: pathname.includes("/settinng"),
|
// icon: "material-symbols:settings",
|
||||||
icon: "material-symbols:settings",
|
// submenus: [
|
||||||
submenus: [
|
// {
|
||||||
{
|
// href: "/admin/settings/banner",
|
||||||
href: "/admin/settings/banner",
|
// label: "Banner",
|
||||||
label: "Banner",
|
// active: pathname === "/admin/settings/banner",
|
||||||
active: pathname === "/admin/settings/banner",
|
// icon: "heroicons:arrow-trending-up",
|
||||||
icon: "heroicons:arrow-trending-up",
|
// children: [],
|
||||||
children: [],
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// href: "/admin/settings/popup",
|
||||||
href: "/admin/settings/popup",
|
// label: "Pop Up",
|
||||||
label: "Pop Up",
|
// active: pathname === "/admin/settings/popup",
|
||||||
active: pathname === "/admin/settings/popup",
|
// icon: "heroicons:arrow-trending-up",
|
||||||
icon: "heroicons:arrow-trending-up",
|
// children: [],
|
||||||
children: [],
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// href: "/admin/settings/iklan",
|
||||||
href: "/admin/settings/iklan",
|
// label: "Iklan",
|
||||||
label: "Iklan",
|
// active: pathname === "/admin/settings/iklan",
|
||||||
active: pathname === "/admin/settings/iklan",
|
// icon: "heroicons:arrow-trending-up",
|
||||||
icon: "heroicons:arrow-trending-up",
|
// children: [],
|
||||||
children: [],
|
// },
|
||||||
},
|
// ],
|
||||||
],
|
// },
|
||||||
},
|
// ],
|
||||||
],
|
// },
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
];
|
];
|
||||||
} else if (Number(userParentLevelId) == 771) {
|
} else if (Number(userParentLevelId) == 771) {
|
||||||
menusSelected = [
|
menusSelected = [
|
||||||
|
|
@ -3141,42 +3129,42 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// groupLabel: "",
|
groupLabel: "",
|
||||||
// id: "settings",
|
id: "settings",
|
||||||
// menus: [
|
menus: [
|
||||||
// {
|
{
|
||||||
// id: "settings",
|
id: "settings",
|
||||||
// href: "/admin/settings",
|
href: "/admin/settings",
|
||||||
// label: t("settings"),
|
label: t("settings"),
|
||||||
// active: pathname.includes("/settinng"),
|
active: pathname.includes("/settinng"),
|
||||||
// icon: "material-symbols:settings",
|
icon: "material-symbols:settings",
|
||||||
// submenus: [
|
submenus: [
|
||||||
// {
|
{
|
||||||
// href: "/admin/settings/banner",
|
href: "/admin/settings/banner",
|
||||||
// label: "Banner",
|
label: "Banner",
|
||||||
// active: pathname === "/admin/settings/banner",
|
active: pathname === "/admin/settings/banner",
|
||||||
// icon: "heroicons:arrow-trending-up",
|
icon: "heroicons:arrow-trending-up",
|
||||||
// children: [],
|
children: [],
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// href: "/admin/settings/popup",
|
href: "/admin/settings/popup",
|
||||||
// label: "Pop Up",
|
label: "Pop Up",
|
||||||
// active: pathname === "/admin/settings/popup",
|
active: pathname === "/admin/settings/popup",
|
||||||
// icon: "heroicons:arrow-trending-up",
|
icon: "heroicons:arrow-trending-up",
|
||||||
// children: [],
|
children: [],
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// href: "/admin/settings/iklan",
|
href: "/admin/settings/iklan",
|
||||||
// label: "Iklan",
|
label: "Iklan",
|
||||||
// active: pathname === "/admin/settings/iklan",
|
active: pathname === "/admin/settings/iklan",
|
||||||
// icon: "heroicons:arrow-trending-up",
|
icon: "heroicons:arrow-trending-up",
|
||||||
// children: [],
|
children: [],
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
// },
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
} else if (Number(roleId) == 9) {
|
} else if (Number(roleId) == 9) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue