feat:update task, update content, update agenda setting
This commit is contained in:
commit
9c78c2a2e2
|
|
@ -37,6 +37,8 @@ import { useDropzone } from "react-dropzone";
|
||||||
import { CloudUpload } from "lucide-react";
|
import { CloudUpload } from "lucide-react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { Upload } from "tus-js-client";
|
import { Upload } from "tus-js-client";
|
||||||
|
import { getCookiesDecrypt } from "@/lib/utils";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
|
|
||||||
const FormSchema = z.object({
|
const FormSchema = z.object({
|
||||||
title: z.string({
|
title: z.string({
|
||||||
|
|
@ -103,6 +105,10 @@ const publishToList = [
|
||||||
export default function CreateCategoryModal() {
|
export default function CreateCategoryModal() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
const roleId = getCookiesDecrypt("urie");
|
||||||
|
const levelNumber = getCookiesDecrypt("ulne");
|
||||||
|
const userLevelId = getCookiesDecrypt("ulie");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
|
|
||||||
const [files, setFiles] = useState<File[]>([]);
|
const [files, setFiles] = useState<File[]>([]);
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
@ -139,6 +145,14 @@ export default function CreateCategoryModal() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getRoles();
|
getRoles();
|
||||||
|
if (Number(levelNumber) === 2) {
|
||||||
|
form.setValue("publishTo", ["polda"]);
|
||||||
|
setUnitData([String(userLevelId)]);
|
||||||
|
}
|
||||||
|
if (Number(levelNumber) === 3) {
|
||||||
|
form.setValue("publishTo", ["satker"]);
|
||||||
|
setSatkerData([String(userLevelId)]);
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
async function getRoles() {
|
async function getRoles() {
|
||||||
|
|
@ -196,6 +210,10 @@ export default function CreateCategoryModal() {
|
||||||
formMedia.append("file", files[0]);
|
formMedia.append("file", files[0]);
|
||||||
formMedia.append("publishedLocation", data.publishTo.sort().join(","));
|
formMedia.append("publishedLocation", data.publishTo.sort().join(","));
|
||||||
formMedia.append("publishedLocationLevel", join);
|
formMedia.append("publishedLocationLevel", join);
|
||||||
|
formMedia.append(
|
||||||
|
"isInt",
|
||||||
|
data.publishTo.includes("internasional") ? "true" : "false"
|
||||||
|
);
|
||||||
|
|
||||||
const response = await postCategory(formMedia);
|
const response = await postCategory(formMedia);
|
||||||
close();
|
close();
|
||||||
|
|
@ -374,93 +392,117 @@ export default function CreateCategoryModal() {
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<FormField
|
{Number(levelNumber) === 1 ? (
|
||||||
control={form.control}
|
<FormField
|
||||||
name="publishTo"
|
control={form.control}
|
||||||
render={() => (
|
name="publishTo"
|
||||||
<FormItem>
|
render={() => (
|
||||||
<FormLabel>Wilayah Publish</FormLabel>
|
<FormItem>
|
||||||
<div className="flex flex-row items-center gap-2">
|
<FormLabel>Wilayah Publish</FormLabel>
|
||||||
<div className="flex gap-3 items-center">
|
|
||||||
<Checkbox
|
<div className="flex flex-row items-center gap-2">
|
||||||
id="all"
|
<div className="flex gap-3 items-center">
|
||||||
checked={isAllTargetChecked}
|
<Checkbox
|
||||||
onCheckedChange={(checked) => {
|
id="all"
|
||||||
if (checked) {
|
checked={isAllTargetChecked}
|
||||||
form.setValue(
|
onCheckedChange={(checked) => {
|
||||||
"publishTo",
|
if (checked) {
|
||||||
publishToList.map((item) => item.id)
|
form.setValue(
|
||||||
);
|
"publishTo",
|
||||||
} else {
|
publishToList.map((item) => item.id)
|
||||||
form.setValue("publishTo", []);
|
);
|
||||||
}
|
} else {
|
||||||
}}
|
form.setValue("publishTo", []);
|
||||||
/>
|
}
|
||||||
<label htmlFor="all" className="text-sm">
|
|
||||||
Semua
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
{publishToList.map((item) => (
|
|
||||||
<>
|
|
||||||
<FormField
|
|
||||||
key={item.id}
|
|
||||||
control={form.control}
|
|
||||||
name="publishTo"
|
|
||||||
render={({ field }) => {
|
|
||||||
return (
|
|
||||||
<FormItem
|
|
||||||
key={item.id}
|
|
||||||
className="flex flex-row items-start "
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<FormControl>
|
|
||||||
<Checkbox
|
|
||||||
checked={field.value?.includes(item.id)}
|
|
||||||
onCheckedChange={(checked) => {
|
|
||||||
return checked
|
|
||||||
? field.onChange([
|
|
||||||
...field.value,
|
|
||||||
item.id,
|
|
||||||
])
|
|
||||||
: field.onChange(
|
|
||||||
field.value?.filter(
|
|
||||||
(value) => value !== item.id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormLabel className="font-normal">
|
|
||||||
{item.name}{" "}
|
|
||||||
</FormLabel>
|
|
||||||
</div>
|
|
||||||
</FormItem>
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{item.id === "polda" &&
|
<label htmlFor="all" className="text-sm">
|
||||||
form.getValues("publishTo")?.includes(item.id) && (
|
Semua
|
||||||
<UnitMapping
|
</label>
|
||||||
unit="Polda"
|
</div>
|
||||||
isDetail={false}
|
{publishToList.map((item) => (
|
||||||
sendDataToParent={(data) => setUnitData(data)}
|
<>
|
||||||
/>
|
<FormField
|
||||||
)}
|
key={item.id}
|
||||||
{item.id === "satker" &&
|
control={form.control}
|
||||||
form.getValues("publishTo")?.includes(item.id) && (
|
name="publishTo"
|
||||||
<UnitMapping
|
render={({ field }) => {
|
||||||
isDetail={false}
|
return (
|
||||||
unit="Satker"
|
<FormItem
|
||||||
sendDataToParent={(data) => setSatkerData(data)}
|
key={item.id}
|
||||||
/>
|
className="flex flex-row items-start "
|
||||||
)}
|
>
|
||||||
</>
|
<div className="flex items-center gap-3">
|
||||||
))}
|
<FormControl>
|
||||||
</div>
|
<Checkbox
|
||||||
<FormMessage />
|
checked={field.value?.includes(item.id)}
|
||||||
</FormItem>
|
onCheckedChange={(checked) => {
|
||||||
)}
|
return checked
|
||||||
/>
|
? field.onChange([
|
||||||
|
...field.value,
|
||||||
|
item.id,
|
||||||
|
])
|
||||||
|
: field.onChange(
|
||||||
|
field.value?.filter(
|
||||||
|
(value) => value !== item.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormLabel className="font-normal">
|
||||||
|
{item.name}{" "}
|
||||||
|
</FormLabel>
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{item.id === "polda" &&
|
||||||
|
form.getValues("publishTo")?.includes(item.id) && (
|
||||||
|
<UnitMapping
|
||||||
|
unit="Polda"
|
||||||
|
isDetail={false}
|
||||||
|
sendDataToParent={(data) => setUnitData(data)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{item.id === "satker" &&
|
||||||
|
form.getValues("publishTo")?.includes(item.id) && (
|
||||||
|
<UnitMapping
|
||||||
|
isDetail={false}
|
||||||
|
unit="Satker"
|
||||||
|
sendDataToParent={(data) => setSatkerData(data)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="publishTo"
|
||||||
|
render={() => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Wilayah Publish</FormLabel>
|
||||||
|
|
||||||
|
<div className="flex flex-row items-center gap-2">
|
||||||
|
<div className="flex gap-3 items-center">
|
||||||
|
<Checkbox disabled checked />
|
||||||
|
<label htmlFor="all" className="text-sm">
|
||||||
|
{poldaState}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="title"
|
name="title"
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ import { UnitMapping } from "./unit-mapping";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import { CloudUpload } from "lucide-react";
|
import { CloudUpload } from "lucide-react";
|
||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
|
import { getCookiesDecrypt } from "@/lib/utils";
|
||||||
|
|
||||||
const FormSchema = z.object({
|
const FormSchema = z.object({
|
||||||
title: z.string({
|
title: z.string({
|
||||||
required_error: "Required",
|
required_error: "Required",
|
||||||
|
|
@ -112,7 +115,10 @@ export default function EditCategoryModal(props: {
|
||||||
const [files, setFiles] = useState<File[]>([]);
|
const [files, setFiles] = useState<File[]>([]);
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
const roleId = getCookiesDecrypt("urie");
|
||||||
|
const levelNumber = getCookiesDecrypt("ulne");
|
||||||
|
const userLevelId = getCookiesDecrypt("ulie");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [satkerData, setSatkerData] = useState<string[]>([]);
|
const [satkerData, setSatkerData] = useState<string[]>([]);
|
||||||
const [unitData, setUnitData] = useState<string[]>([]);
|
const [unitData, setUnitData] = useState<string[]>([]);
|
||||||
|
|
@ -344,7 +350,6 @@ export default function EditCategoryModal(props: {
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="selectedUser"
|
name="selectedUser"
|
||||||
|
|
@ -417,98 +422,122 @@ export default function EditCategoryModal(props: {
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="publishTo"
|
|
||||||
render={() => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>Wilayah Publish</FormLabel>
|
|
||||||
|
|
||||||
<div className="flex flex-row items-center gap-2">
|
{Number(levelNumber) === 1 ? (
|
||||||
<div className="flex gap-3 items-center">
|
<FormField
|
||||||
<Checkbox
|
control={form.control}
|
||||||
id="all"
|
name="publishTo"
|
||||||
checked={isAllTargetChecked}
|
render={() => (
|
||||||
disabled={isDetail}
|
<FormItem>
|
||||||
onCheckedChange={(checked) => {
|
<FormLabel>Wilayah Publish</FormLabel>
|
||||||
if (checked) {
|
|
||||||
form.setValue(
|
<div className="flex flex-row items-center gap-2">
|
||||||
"publishTo",
|
<div className="flex gap-3 items-center">
|
||||||
publishToList.map((item) => item.id)
|
<Checkbox
|
||||||
);
|
id="all"
|
||||||
} else {
|
checked={isAllTargetChecked}
|
||||||
form.setValue("publishTo", []);
|
disabled={isDetail}
|
||||||
}
|
onCheckedChange={(checked) => {
|
||||||
}}
|
if (checked) {
|
||||||
/>
|
form.setValue(
|
||||||
<label htmlFor="all" className="text-sm">
|
"publishTo",
|
||||||
Semua
|
publishToList.map((item) => item.id)
|
||||||
</label>
|
);
|
||||||
</div>
|
} else {
|
||||||
{publishToList.map((item) => (
|
form.setValue("publishTo", []);
|
||||||
<>
|
}
|
||||||
<FormField
|
|
||||||
key={item.id}
|
|
||||||
control={form.control}
|
|
||||||
name="publishTo"
|
|
||||||
render={({ field }) => {
|
|
||||||
return (
|
|
||||||
<FormItem
|
|
||||||
key={item.id}
|
|
||||||
className="flex flex-row items-start "
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<FormControl>
|
|
||||||
<Checkbox
|
|
||||||
disabled={isDetail}
|
|
||||||
checked={field.value?.includes(item.id)}
|
|
||||||
onCheckedChange={(checked) => {
|
|
||||||
return checked
|
|
||||||
? field.onChange([
|
|
||||||
...field.value,
|
|
||||||
item.id,
|
|
||||||
])
|
|
||||||
: field.onChange(
|
|
||||||
field.value?.filter(
|
|
||||||
(value) => value !== item.id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormLabel className="font-normal">
|
|
||||||
{item.name}{" "}
|
|
||||||
</FormLabel>
|
|
||||||
</div>
|
|
||||||
</FormItem>
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{item.id === "polda" &&
|
<label htmlFor="all" className="text-sm">
|
||||||
form.getValues("publishTo")?.includes(item.id) && (
|
Semua
|
||||||
<UnitMapping
|
</label>
|
||||||
unit="Polda"
|
</div>
|
||||||
sendDataToParent={(data) => setUnitData(data)}
|
{publishToList.map((item) => (
|
||||||
isDetail={isDetail ? true : false}
|
<>
|
||||||
initData={unitData}
|
<FormField
|
||||||
/>
|
key={item.id}
|
||||||
)}
|
control={form.control}
|
||||||
{item.id === "satker" &&
|
name="publishTo"
|
||||||
form.getValues("publishTo")?.includes(item.id) && (
|
render={({ field }) => {
|
||||||
<UnitMapping
|
return (
|
||||||
unit="Satker"
|
<FormItem
|
||||||
sendDataToParent={(data) => setSatkerData(data)}
|
key={item.id}
|
||||||
isDetail={isDetail ? true : false}
|
className="flex flex-row items-start "
|
||||||
initData={satkerData}
|
>
|
||||||
/>
|
<div className="flex items-center gap-3">
|
||||||
)}
|
<FormControl>
|
||||||
</>
|
<Checkbox
|
||||||
))}
|
disabled={isDetail}
|
||||||
</div>
|
checked={field.value?.includes(item.id)}
|
||||||
<FormMessage />
|
onCheckedChange={(checked) => {
|
||||||
</FormItem>
|
return checked
|
||||||
)}
|
? field.onChange([
|
||||||
/>
|
...field.value,
|
||||||
|
item.id,
|
||||||
|
])
|
||||||
|
: field.onChange(
|
||||||
|
field.value?.filter(
|
||||||
|
(value) => value !== item.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormLabel className="font-normal">
|
||||||
|
{item.name}{" "}
|
||||||
|
</FormLabel>
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{item.id === "polda" &&
|
||||||
|
form.getValues("publishTo")?.includes(item.id) && (
|
||||||
|
<UnitMapping
|
||||||
|
unit="Polda"
|
||||||
|
sendDataToParent={(data) => setUnitData(data)}
|
||||||
|
isDetail={isDetail ? true : false}
|
||||||
|
initData={unitData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{item.id === "satker" &&
|
||||||
|
form.getValues("publishTo")?.includes(item.id) && (
|
||||||
|
<UnitMapping
|
||||||
|
unit="Satker"
|
||||||
|
sendDataToParent={(data) => setSatkerData(data)}
|
||||||
|
isDetail={isDetail ? true : false}
|
||||||
|
initData={satkerData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="publishTo"
|
||||||
|
render={() => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Wilayah Publish</FormLabel>
|
||||||
|
|
||||||
|
<div className="flex flex-row items-center gap-2">
|
||||||
|
<div className="flex gap-3 items-center">
|
||||||
|
<Checkbox disabled checked />
|
||||||
|
<label htmlFor="all" className="text-sm">
|
||||||
|
{poldaState}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="title"
|
name="title"
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking";
|
import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking";
|
||||||
|
import ImageBlurry from "@/components/ui/image-blurry";
|
||||||
|
|
||||||
const Galery = (props: any) => {
|
const Galery = (props: any) => {
|
||||||
const [profile, setProfile] = useState<any>();
|
const [profile, setProfile] = useState<any>();
|
||||||
|
|
@ -284,20 +285,6 @@ const Galery = (props: any) => {
|
||||||
<div className="mx-auto w-full max-w-7xl justify-start flex flex-col lg:flex-row gap-5 mb-4">
|
<div className="mx-auto w-full max-w-7xl justify-start flex flex-col lg:flex-row gap-5 mb-4">
|
||||||
<Tabs value={selectedTab} onValueChange={setSelectedTab}>
|
<Tabs value={selectedTab} onValueChange={setSelectedTab}>
|
||||||
<TabsList className="grid grid-cols-2 lg:flex lg:flex-row ">
|
<TabsList className="grid grid-cols-2 lg:flex lg:flex-row ">
|
||||||
<TabsTrigger
|
|
||||||
value="video"
|
|
||||||
className="relative text-xs 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>
|
|
||||||
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
|
||||||
<TabsTrigger
|
|
||||||
value="audio"
|
|
||||||
className="relative text-xs 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>
|
|
||||||
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
value="image"
|
value="image"
|
||||||
className="relative text-xs 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"
|
className="relative text-xs 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"
|
||||||
|
|
@ -305,12 +292,26 @@ const Galery = (props: any) => {
|
||||||
Foto
|
Foto
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
||||||
|
<TabsTrigger
|
||||||
|
value="video"
|
||||||
|
className="relative text-xs 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>
|
||||||
|
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
value="text"
|
value="text"
|
||||||
className="relative text-xs 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"
|
className="relative text-xs 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
|
Teks
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
|
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
||||||
|
<TabsTrigger
|
||||||
|
value="audio"
|
||||||
|
className="relative text-xs 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>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -323,9 +324,12 @@ const Galery = (props: any) => {
|
||||||
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
||||||
<div>
|
<div>
|
||||||
<Link href={`/video/detail/${video?.mediaUpload?.slug}`}>
|
<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 " />
|
{/* <img src={video?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg " /> */}
|
||||||
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{video?.mediaUpload?.title}</div>
|
<div className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg">
|
||||||
|
<ImageBlurry src={video?.mediaUpload?.thumbnailLink} alt={video?.mediaUpload?.title} style={{ objectFit: "contain", width: "100%", height: "100%" }} />
|
||||||
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{video?.mediaUpload?.title}</div>
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger className="flex justify-end gap-1 cursor-pointer" asChild>
|
<PopoverTrigger className="flex justify-end gap-1 cursor-pointer" asChild>
|
||||||
<a className="flex justify-end items-end place-items-end">
|
<a className="flex justify-end items-end place-items-end">
|
||||||
|
|
@ -454,9 +458,12 @@ const Galery = (props: any) => {
|
||||||
<Card key={image?.id}>
|
<Card key={image?.id}>
|
||||||
<CardContent className="flex flex-col bg-black dark:bg-white w-full h-full rounded-lg p-0">
|
<CardContent className="flex flex-col bg-black dark:bg-white w-full h-full rounded-lg p-0">
|
||||||
<Link href={`/image/detail/${image?.mediaUpload?.slug}`}>
|
<Link href={`/image/detail/${image?.mediaUpload?.slug}`}>
|
||||||
<img src={image?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" />
|
{/* <img src={image?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" /> */}
|
||||||
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{image?.mediaUpload?.title}</div>
|
<div className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg">
|
||||||
|
<ImageBlurry src={image?.mediaUpload?.thumbnailLink} alt={image?.mediaUpload?.title} style={{ objectFit: "contain", width: "100%", height: "100%" }} />
|
||||||
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{image?.mediaUpload?.title}</div>
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger className="flex justify-end gap-1 cursor-pointer" asChild>
|
<PopoverTrigger className="flex justify-end gap-1 cursor-pointer" asChild>
|
||||||
<a className="flex justify-end items-end place-items-end">
|
<a className="flex justify-end items-end place-items-end">
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import { Icon } from "@iconify/react/dist/iconify.js";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking";
|
import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking";
|
||||||
|
import ImageBlurry from "@/components/ui/image-blurry";
|
||||||
|
|
||||||
const Galery = (props: any) => {
|
const Galery = (props: any) => {
|
||||||
const [profile, setProfile] = useState<any>();
|
const [profile, setProfile] = useState<any>();
|
||||||
|
|
@ -290,20 +291,6 @@ const Galery = (props: any) => {
|
||||||
<div className="mx-auto w-full max-w-7xl justify-start flex flex-col lg:flex-row gap-5 mb-4">
|
<div className="mx-auto w-full max-w-7xl justify-start flex flex-col lg:flex-row gap-5 mb-4">
|
||||||
<Tabs value={selectedTab} onValueChange={setSelectedTab}>
|
<Tabs value={selectedTab} onValueChange={setSelectedTab}>
|
||||||
<TabsList className="grid grid-cols-2 lg:flex lg:flex-row ">
|
<TabsList className="grid grid-cols-2 lg:flex lg:flex-row ">
|
||||||
<TabsTrigger
|
|
||||||
value="video"
|
|
||||||
className="relative text-xs 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>
|
|
||||||
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
|
||||||
<TabsTrigger
|
|
||||||
value="audio"
|
|
||||||
className="relative text-xs 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>
|
|
||||||
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
value="image"
|
value="image"
|
||||||
className="relative text-xs 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"
|
className="relative text-xs 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"
|
||||||
|
|
@ -311,12 +298,26 @@ const Galery = (props: any) => {
|
||||||
Foto
|
Foto
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
||||||
|
<TabsTrigger
|
||||||
|
value="video"
|
||||||
|
className="relative text-xs 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>
|
||||||
|
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
value="text"
|
value="text"
|
||||||
className="relative text-xs 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"
|
className="relative text-xs 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
|
Teks
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
|
<div className="text-[#bb3523] text-lg hidden md:inline-block">|</div>
|
||||||
|
<TabsTrigger
|
||||||
|
value="audio"
|
||||||
|
className="relative text-xs 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>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -329,7 +330,10 @@ const Galery = (props: any) => {
|
||||||
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
||||||
<div>
|
<div>
|
||||||
<Link href={`/video/detail/${video?.mediaUpload?.slug}`}>
|
<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" />
|
{/* <img src={video?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" /> */}
|
||||||
|
<div className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg">
|
||||||
|
<ImageBlurry src={video?.mediaUpload?.thumbnailLink} alt={video?.mediaUpload?.title} style={{ objectFit: "contain", width: "100%", height: "100%" }} />
|
||||||
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{video?.mediaUpload?.title}</div>
|
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{video?.mediaUpload?.title}</div>
|
||||||
<Popover>
|
<Popover>
|
||||||
|
|
@ -458,9 +462,12 @@ const Galery = (props: any) => {
|
||||||
<Card key={image?.id}>
|
<Card key={image?.id}>
|
||||||
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
||||||
<Link href={`/image/detail/${image?.mediaUpload?.slug}`}>
|
<Link href={`/image/detail/${image?.mediaUpload?.slug}`}>
|
||||||
<img src={image?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" />
|
{/* <img src={image?.mediaUpload?.thumbnailLink} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" /> */}
|
||||||
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{image?.mediaUpload?.title}</div>
|
<div className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg">
|
||||||
|
<ImageBlurry src={image?.mediaUpload?.thumbnailLink} alt={image?.mediaUpload?.title} style={{ objectFit: "contain", width: "100%", height: "100%" }} />
|
||||||
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{image?.mediaUpload?.title}</div>
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger className="flex justify-end gap-1 cursor-pointer" asChild>
|
<PopoverTrigger className="flex justify-end gap-1 cursor-pointer" asChild>
|
||||||
<a className="flex justify-end items-end place-items-end">
|
<a className="flex justify-end items-end place-items-end">
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import { Icon } from "@iconify/react/dist/iconify.js";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking";
|
import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking";
|
||||||
|
import ImageBlurry from "@/components/ui/image-blurry";
|
||||||
|
|
||||||
const page = () => {
|
const page = () => {
|
||||||
const [, setProfile] = useState();
|
const [, setProfile] = useState();
|
||||||
|
|
@ -210,7 +211,10 @@ const page = () => {
|
||||||
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
<CardContent className="flex flex-col bg-black dark:bg-white w-full rounded-lg p-0">
|
||||||
<div className="">
|
<div className="">
|
||||||
<Link href={`/content-management/rewrite/detail/${image.id}`}>
|
<Link href={`/content-management/rewrite/detail/${image.id}`}>
|
||||||
<img src={image?.thumbnailUrl} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" />
|
{/* <img src={image?.thumbnailUrl} className="h-40 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" /> */}
|
||||||
|
<div className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg">
|
||||||
|
<ImageBlurry src={image?.thumbnailUrl} alt={image?.title} style={{ objectFit: "contain", width: "100%", height: "100%" }} />
|
||||||
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{image?.title}</div>
|
<div className="font-semibold p-4 text-white text-xs lg:text-sm dark:text-black truncate w-full">{image?.title}</div>
|
||||||
<Popover>
|
<Popover>
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ const FilterPage = () => {
|
||||||
endDateString,
|
endDateString,
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "",
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "",
|
||||||
locale == "en" ? true : false,
|
locale == "en" ? true : false
|
||||||
);
|
);
|
||||||
close();
|
close();
|
||||||
// setGetTotalPage(response?.data?.data?.totalPages);
|
// setGetTotalPage(response?.data?.data?.totalPages);
|
||||||
|
|
@ -189,7 +189,7 @@ const FilterPage = () => {
|
||||||
endDateString,
|
endDateString,
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]?.replace("", "") : "",
|
||||||
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "",
|
monthYearFilter ? getOnlyMonthAndYear(monthYearFilter)?.split("/")[1] : "",
|
||||||
locale == "en" ? true : false,
|
locale == "en" ? true : false
|
||||||
);
|
);
|
||||||
close();
|
close();
|
||||||
// setGetTotalPage(response?.data?.data?.totalPages);
|
// setGetTotalPage(response?.data?.data?.totalPages);
|
||||||
|
|
@ -491,14 +491,8 @@ const FilterPage = () => {
|
||||||
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
||||||
<Link href={`/image/detail/${image?.slug}`}>
|
<Link href={`/image/detail/${image?.slug}`}>
|
||||||
{/* <img src={image?.thumbnailLink} className="h-60 object-cover items-center justify-center cursor-pointer rounded-lg" /> */}
|
{/* <img src={image?.thumbnailLink} className="h-60 object-cover items-center justify-center cursor-pointer rounded-lg" /> */}
|
||||||
<div
|
<div className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg">
|
||||||
className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg"
|
<ImageBlurry src={image?.thumbnailLink} alt={image?.title} style={{ objectFit: "contain", width: "100%", height: "100%" }} />
|
||||||
>
|
|
||||||
<ImageBlurry
|
|
||||||
src={image?.thumbnailLink}
|
|
||||||
alt={image?.title}
|
|
||||||
style={{ objectFit: "contain", width: "100%", height: "100%" }}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row items-center gap-2 text-[10px] mx-2 mt-2">
|
<div className="flex flex-row items-center gap-2 text-[10px] mx-2 mt-2">
|
||||||
{formatDateToIndonesian(new Date(image?.createdAt))} {image?.timezone ? image?.timezone : "WIB"}| <Icon icon="formkit:eye" width="15" height="15" />
|
{formatDateToIndonesian(new Date(image?.createdAt))} {image?.timezone ? image?.timezone : "WIB"}| <Icon icon="formkit:eye" width="15" height="15" />
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import { useRouter } from "@/i18n/routing";
|
||||||
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog";
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog";
|
||||||
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion";
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion";
|
||||||
import { close, loading } from "@/config/swal";
|
import { close, loading } from "@/config/swal";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const timeList = [
|
const timeList = [
|
||||||
{
|
{
|
||||||
|
|
@ -118,16 +119,15 @@ const Schedule = (props: any) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [startDate, setStartDate] = useState<Date | undefined>(new Date());
|
const [startDate, setStartDate] = useState<Date | undefined>(new Date());
|
||||||
const [dateAWeek, setDateAWeek] = useState<string[]>([]);
|
const [dateAWeek, setDateAWeek] = useState<string[]>([]);
|
||||||
const [scheduleSearch, setScheduleSearch] = useState();
|
|
||||||
const [todayList, setTodayList] = useState([]);
|
const [todayList, setTodayList] = useState([]);
|
||||||
const [prevdayList, setPrevdayList] = useState([]);
|
const [prevdayList, setPrevdayList] = useState([]);
|
||||||
const [nextdayList, setNextdayList] = useState([]);
|
const [nextdayList, setNextdayList] = useState([]);
|
||||||
const [isOpen, setIsOpen] = React.useState(false);
|
|
||||||
const [schedules, setSchedules] = useState([]);
|
const [schedules, setSchedules] = useState([]);
|
||||||
const [openDialog, setOpenDialog] = useState(false);
|
const [openDialog, setOpenDialog] = useState(false);
|
||||||
const [detail, setDetail] = useState<any>();
|
const [detail, setDetail] = useState<any>();
|
||||||
const [content, setContent] = useState();
|
const [content, setContent] = useState();
|
||||||
const { id } = props;
|
const { id } = props;
|
||||||
|
const t = useTranslations("LandingPage");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getDataSchedule() {
|
async function getDataSchedule() {
|
||||||
|
|
@ -511,10 +511,10 @@ const Schedule = (props: any) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Component Kanan */}
|
{/* komponen Kanan */}
|
||||||
<div className="w-1/4 flex flex-col gap-6">
|
<div className="w-1/4 flex flex-col gap-6">
|
||||||
<div className="relative text-gray-600 dark:text-white">
|
<div className="relative text-gray-600 dark:text-white">
|
||||||
<input type="text" placeholder="Masukkan Judul Jadwal" className="pl-8 pr-4 py-1 w-full border rounded-full text-sm focus:outline-none" />
|
<input type="text" placeholder={t("titleSchedule")} className="pl-8 pr-4 py-1 w-full border rounded-full text-sm focus:outline-none" />
|
||||||
<span className="absolute left-2 top-1/2 transform -translate-y-1/2">
|
<span className="absolute left-2 top-1/2 transform -translate-y-1/2">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
||||||
<g fill="none" fill-rule="evenodd">
|
<g fill="none" fill-rule="evenodd">
|
||||||
|
|
@ -557,6 +557,7 @@ const Schedule = (props: any) => {
|
||||||
</CollapsibleContent>
|
</CollapsibleContent>
|
||||||
))}
|
))}
|
||||||
</Collapsible> */}
|
</Collapsible> */}
|
||||||
|
|
||||||
<Accordion type="single" collapsible className="w-full">
|
<Accordion type="single" collapsible className="w-full">
|
||||||
<AccordionItem value="item-1">
|
<AccordionItem value="item-1">
|
||||||
<AccordionTrigger>Jadwal Hari ini</AccordionTrigger>
|
<AccordionTrigger>Jadwal Hari ini</AccordionTrigger>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
|
||||||
const DetailVideo = () => {
|
const DetailVideo = () => {
|
||||||
const [selectedSize, setSelectedSize] = useState<string>("L");
|
const [selectedSize, setSelectedSize] = useState<string>("L");
|
||||||
const [selectedTab, setSelectedTab] = useState("video");
|
const [selectedTab, setSelectedTab] = useState("video");
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import ReactDatePicker from "react-datepicker";
|
||||||
import "react-datepicker/dist/react-datepicker.css";
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
import { close, loading } from "@/config/swal";
|
import { close, loading } from "@/config/swal";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import ImageBlurry from "@/components/ui/image-blurry";
|
||||||
|
|
||||||
const columns: ColumnDef<any>[] = [
|
const columns: ColumnDef<any>[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -518,7 +519,10 @@ const FilterPage = () => {
|
||||||
<Card key={video?.id} className="hover:scale-110 transition-transform duration-300">
|
<Card key={video?.id} className="hover:scale-110 transition-transform duration-300">
|
||||||
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
||||||
<Link href={`/video/detail/${video?.slug}`}>
|
<Link href={`/video/detail/${video?.slug}`}>
|
||||||
<img src={video?.thumbnailLink} className="h-60 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" />
|
{/* <img src={video?.thumbnailLink} className="h-60 object-cover items-center justify-center cursor-pointer rounded-lg place-self-center" /> */}
|
||||||
|
<div className="img-container h-60 bg-[#e9e9e9] cursor-pointer rounded-lg">
|
||||||
|
<ImageBlurry src={video?.thumbnailLink} alt={video?.title} style={{ objectFit: "contain", width: "100%", height: "100%" }} />
|
||||||
|
</div>
|
||||||
<div className="flex flex-row items-center gap-2 text-[10px] mx-2">
|
<div className="flex flex-row items-center gap-2 text-[10px] mx-2">
|
||||||
{formatDateToIndonesian(new Date(video?.createdAt))} {video?.timezone ? video?.timezone : "WIB"}| <Icon icon="formkit:eye" width="15" height="15" />
|
{formatDateToIndonesian(new Date(video?.createdAt))} {video?.timezone ? video?.timezone : "WIB"}| <Icon icon="formkit:eye" width="15" height="15" />
|
||||||
{video?.clickCount}{" "}
|
{video?.clickCount}{" "}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import { Textarea } from "@/components/ui/textarea";
|
||||||
import { Icon } from "@/components/ui/icon";
|
import { Icon } from "@/components/ui/icon";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
import ReactPasswordChecklist from "react-password-checklist";
|
import ReactPasswordChecklist from "react-password-checklist";
|
||||||
|
import { Select } from "@/components/ui/select";
|
||||||
|
|
||||||
type Inputs = {
|
type Inputs = {
|
||||||
example: string;
|
example: string;
|
||||||
|
|
@ -34,7 +35,7 @@ const PasswordChecklist = dynamic(() => import("react-password-checklist"), {
|
||||||
|
|
||||||
const page = () => {
|
const page = () => {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const [stepOneActive] = useState(true);
|
const [stepOneActive, setStepOneActive] = useState(true);
|
||||||
const [stepTwoActive, setStepTwoActive] = useState(false);
|
const [stepTwoActive, setStepTwoActive] = useState(false);
|
||||||
const [stepThreeActive, setStepThreeActive] = useState(false);
|
const [stepThreeActive, setStepThreeActive] = useState(false);
|
||||||
const [typePass, setTypePass] = useState("password");
|
const [typePass, setTypePass] = useState("password");
|
||||||
|
|
@ -66,6 +67,7 @@ const page = () => {
|
||||||
const [districts, setDistricts] = useState([]);
|
const [districts, setDistricts] = useState([]);
|
||||||
const [, setAssociation] = useState<any>();
|
const [, setAssociation] = useState<any>();
|
||||||
const [warningPassConf] = useState();
|
const [warningPassConf] = useState();
|
||||||
|
const [otpValue, setOtpValue] = useState("");
|
||||||
|
|
||||||
const [otp1, setOtp1] = useState();
|
const [otp1, setOtp1] = useState();
|
||||||
const [otp2, setOtp2] = useState();
|
const [otp2, setOtp2] = useState();
|
||||||
|
|
@ -450,23 +452,27 @@ const page = () => {
|
||||||
|
|
||||||
const handleVerifyOTP = async () => {
|
const handleVerifyOTP = async () => {
|
||||||
const otp = `${otp1}${otp2}${otp3}${otp4}${otp5}${otp6}`;
|
const otp = `${otp1}${otp2}${otp3}${otp4}${otp5}${otp6}`;
|
||||||
|
const dummyOtp = "123456";
|
||||||
if (email != "" && otp.length == 6) {
|
if (email != "" && otpValue.length == 6) {
|
||||||
console.log("verify otp");
|
console.log("verify otp");
|
||||||
loading();
|
loading();
|
||||||
// const response = {
|
// const response = {
|
||||||
// message: "success",
|
// message: "success",
|
||||||
// };
|
// };
|
||||||
|
const response = {
|
||||||
|
message: otpValue == dummyOtp ? "success" : "failed",
|
||||||
|
};
|
||||||
|
|
||||||
const response = await verifyOTP(email, otp);
|
// const response = await verifyOTP(email, otp);
|
||||||
if (response?.error) {
|
// if (response?.error) {
|
||||||
error(response?.message);
|
// error(response?.message);
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
close();
|
close();
|
||||||
// console.log(response);
|
// console.log(response);
|
||||||
if (response?.message == "success") {
|
if (response?.message == "success") {
|
||||||
console.log("success");
|
console.log("success");
|
||||||
|
setStepTwoActive(false);
|
||||||
setStepThreeActive(true);
|
setStepThreeActive(true);
|
||||||
setFormProfile(true);
|
setFormProfile(true);
|
||||||
setOtpValidate("");
|
setOtpValidate("");
|
||||||
|
|
@ -548,26 +554,20 @@ const page = () => {
|
||||||
<div className="flex flex-row justify-center py-10">
|
<div className="flex flex-row justify-center py-10">
|
||||||
<ul className="flex flex-row items-center text-center">
|
<ul className="flex flex-row items-center text-center">
|
||||||
<li>
|
<li>
|
||||||
<div className={`text-center text-black bg-[#f32d2d] h-[40px] w-[40px] border rounded-full ${stepOneActive ? "active bg-white border border-[#f32d2d] rounded-full text-[#f32d2d]" : ""}`}>
|
<div className={`flex justify-center items-center text-center text-black bg-[#f32d2d] h-[40px] w-[40px] border rounded-full ${stepOneActive ? "active bg-white border border-[#f32d2d] rounded-full text-[#f32d2d]" : ""}`}>
|
||||||
<span>
|
<b>1</b>
|
||||||
<b className="items-center">1</b>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<div className="w-16 h-1 z-[1] bg-[#f32d2d] "></div>
|
<div className="w-16 h-1 z-[1] bg-[#f32d2d] "></div>
|
||||||
<li>
|
<li>
|
||||||
<div className={`text-center text-white bg-[#f32d2d] h-[40px] w-[40px] border rounded-full ${stepTwoActive ? "active bg-white border border-[#f32d2d] rounded-full text-[#f32d2d]" : ""}`}>
|
<div className={`flex justify-center items-center text-center text-black bg-[#f32d2d] h-[40px] w-[40px] border rounded-full ${stepTwoActive ? "active bg-white border border-[#f32d2d] rounded-full text-[#f32d2d]" : ""}`}>
|
||||||
<span>
|
<b>2</b>
|
||||||
<b>2</b>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<div className="w-16 h-1 bg-[#f32d2d]"></div>
|
<div className="w-16 h-1 bg-[#f32d2d]"></div>
|
||||||
<li>
|
<li>
|
||||||
<div className={`text-center text-white bg-[#f32d2d] h-[40px] w-[40px] borde rounded-full ${stepThreeActive ? "active bg-white border border-[#f32d2d] rounded-full text-[#f32d2d]" : ""}`}>
|
<div className={`flex justify-center items-center text-center text-black bg-[#f32d2d] h-[40px] w-[40px] borde rounded-full ${stepThreeActive ? "active bg-white border border-[#f32d2d] rounded-full text-[#f32d2d]" : ""}`}>
|
||||||
<span>
|
<b>3</b>
|
||||||
<b>3</b>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -585,7 +585,7 @@ const page = () => {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<p className="text-4xl px-12 font-bold ">{stepThreeActive ? "Silahkan lengkapi data pengguna" : "Silahkan registrasi terlebih dahulu"}</p>
|
<p className="text-4xl px-12 font-bold ">{stepThreeActive ? "Silahkan lengkapi data pengguna" : "Silahkan registrasi terlebih dahulu"}</p>
|
||||||
<p className="px-12">
|
<p className="px-12 mt-2">
|
||||||
Sudah memiliki akun?{" "}
|
Sudah memiliki akun?{" "}
|
||||||
<Link href="/auth" className="text-red-500">
|
<Link href="/auth" className="text-red-500">
|
||||||
<b>Masuk</b>
|
<b>Masuk</b>
|
||||||
|
|
@ -593,6 +593,7 @@ const page = () => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
className="px-20 mb-6"
|
||||||
style={
|
style={
|
||||||
!stepTwoActive || (stepOneActive && stepThreeActive)
|
!stepTwoActive || (stepOneActive && stepThreeActive)
|
||||||
? {
|
? {
|
||||||
|
|
@ -601,10 +602,8 @@ const page = () => {
|
||||||
: {}
|
: {}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<h2 className="text-black px-12">
|
<p className="text-black text-2xl px-20 font-semibold">Masukkan Kode OTP</p>
|
||||||
<b>Masukkan Kode OTP</b>
|
<p className="text-red-500 text-sm px-20">Silahkan cek inbox atau kotak spam pada email Anda.</p>
|
||||||
</h2>
|
|
||||||
<p className="text-red-500 px-12">Silahkan cek inbox atau kotak spam pada email Anda.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -684,9 +683,9 @@ const page = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={`flex flex-row mt-4 px-12 ${!stepTwoActive || stepThreeActive ? "hidden" : ""}`}>
|
<div className={`flex flex-col mt-4 px-12 ${!stepTwoActive || stepThreeActive ? "hidden" : ""}`}>
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center mb-6">
|
||||||
<InputOTP maxLength={6}>
|
<InputOTP maxLength={6} onChange={(e) => setOtpValue(e)}>
|
||||||
<InputOTPGroup>
|
<InputOTPGroup>
|
||||||
<InputOTPSlot index={0} onChange={(e: any) => setOtp1(e.target.value)} onKeyUp={handleTypeOTP} />
|
<InputOTPSlot index={0} onChange={(e: any) => setOtp1(e.target.value)} onKeyUp={handleTypeOTP} />
|
||||||
<InputOTPSlot index={1} onChange={(e: any) => setOtp2(e.target.value)} onKeyUp={handleTypeOTP} />
|
<InputOTPSlot index={1} onChange={(e: any) => setOtp2(e.target.value)} onKeyUp={handleTypeOTP} />
|
||||||
|
|
@ -706,17 +705,17 @@ const page = () => {
|
||||||
<p className="text-red-500">
|
<p className="text-red-500">
|
||||||
<b>{otpValidate}</b>
|
<b>{otpValidate}</b>
|
||||||
</p>
|
</p>
|
||||||
<div className="flex justify-between mt-4">
|
<div className="flex flex-row px-28 justify-between items-center my-4">
|
||||||
<a className="mr-1 w-full text-base cursor-pointer" onClick={() => handleResendOTP()}>
|
<a className="bg-slate-300 text-center rounded-lg mr-1 w-[200px] py-2 text-base cursor-pointer" onClick={() => handleResendOTP()}>
|
||||||
Kirim Ulang ({convertMilisecondsToHour(timerCount)})
|
Kirim Ulang ({convertMilisecondsToHour(timerCount)})
|
||||||
</a>
|
</a>
|
||||||
<a className="text-red-500 ml-1 w-[75%] cursor-pointer" onClick={() => handleVerifyOTP()}>
|
<a className="bg-red-700 w-[200px] py-2 text-center text-white rounded-lg ml-1 cursor-pointer" onClick={() => handleVerifyOTP()}>
|
||||||
Lanjut
|
Lanjut
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={`flex flex-row my-4 px-12 ${formProfile == false ? "hidden" : ""}`}>
|
<div className={`flex flex-col gap-3 my-4 px-12 ${formProfile == false ? "hidden" : ""}`}>
|
||||||
<div>
|
<div>
|
||||||
{Number(category) == 6 || Number(category) == 7 ? (
|
{Number(category) == 6 || Number(category) == 7 ? (
|
||||||
<div className="">
|
<div className="">
|
||||||
|
|
@ -737,15 +736,15 @@ const page = () => {
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
<div className="">
|
<div className="mb-4">
|
||||||
<label className="">
|
<label className="mb-2">
|
||||||
<b>Nama Lengkap</b> <span className="text-red-500">*</span>
|
<b>Nama Lengkap</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<Input type="text" autoComplete="off" className={` ${errors.firstName ? "block" : ""}`} {...register("firstName")} placeholder="Masukan Nama Lengkap Anda" />
|
<Input type="text" autoComplete="off" className={` ${errors.firstName ? "block" : ""}`} {...register("firstName")} placeholder="Masukan Nama Lengkap Anda" />
|
||||||
<div className="text-red-500">{errors.firstName?.message}</div>
|
<div className="text-red-500">{errors.firstName?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="mb-4">
|
||||||
<label className="">
|
<label className="mb-2">
|
||||||
<b>Username</b> <span className="text-red-500">*</span>
|
<b>Username</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<Input
|
<Input
|
||||||
|
|
@ -766,30 +765,30 @@ const page = () => {
|
||||||
/>
|
/>
|
||||||
<div className="text-red-500">{errors.username?.message}</div>
|
<div className="text-red-500">{errors.username?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="mb-4">
|
||||||
<label className="">
|
<label className="mb-2">
|
||||||
<b>Email</b> <span className="text-red-500">*</span>
|
<b>Email</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<Input type="email" autoComplete="off" className={` ${errors.email ? "block" : ""}`} {...register("email")} placeholder="Masukan Email Anda" disabled />
|
<Input type="email" autoComplete="off" className={` ${errors.email ? "block" : ""}`} {...register("email")} placeholder="Masukan Email Anda" disabled />
|
||||||
<div className="text-red-500">{errors.email?.message}</div>
|
<div className="text-red-500">{errors.email?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="flex flex-col">
|
||||||
<label className="form-label">
|
<label className="mb-2">
|
||||||
<b>No. HP</b> <span className="text-red-500">*</span>
|
<b>No. HP</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<input type="number" autoComplete="off" className={` ${errors.phoneNumber ? "block" : ""}`} {...register("phoneNumber")} placeholder="Masukan Nomor Telepon Anda" />
|
<Input type="number" autoComplete="off" className={` ${errors.phoneNumber ? "block" : ""}`} {...register("phoneNumber")} placeholder="Masukan Nomor Telepon Anda" />
|
||||||
<div className="text-red-500">{errors.phoneNumber?.message}</div>
|
<div className="text-red-500">{errors.phoneNumber?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="mb-4">
|
||||||
<label htmlFor="address" className="">
|
<label htmlFor="address" className="mb-2">
|
||||||
<b>Alamat</b> <span className="text-red-500">*</span>
|
<b>Alamat</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<Textarea className={`form-control ${errors.address ? "block" : ""}`} {...register("address")} placeholder="Masukan Alamat Lengkap Anda" rows={3} />
|
<Textarea className={`form-control ${errors.address ? "block" : ""}`} {...register("address")} placeholder="Masukan Alamat Lengkap Anda" rows={3} />
|
||||||
<div className="text-red-500">{errors.address?.message}</div>
|
<div className="text-red-500">{errors.address?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
{Number(category) == 6 ? (
|
{Number(category) == 6 ? (
|
||||||
<div>
|
<div className="flex flex-col gap-3">
|
||||||
<div className="">
|
<div className="">
|
||||||
<label htmlFor="provinsi">
|
<label htmlFor="provinsi">
|
||||||
<b>Pilih Institusi</b> <span className="text-red-500">*</span>
|
<b>Pilih Institusi</b> <span className="text-red-500">*</span>
|
||||||
|
|
@ -818,10 +817,10 @@ const page = () => {
|
||||||
: {}
|
: {}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<label htmlFor="alamat" className="">
|
<label htmlFor="alamat" className="mb-2">
|
||||||
<b>Nama Institusi</b> <span className="text-red-500">*</span>
|
<b>Nama Institusi</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<input className="" autoComplete="off" placeholder="Masukan Nama Lengkap Institusi Anda" type="text" onChange={(event) => setCustomInstituteName(event.target.value)} />
|
<Input className="" autoComplete="off" placeholder="Masukan Nama Lengkap Institusi Anda" type="text" onChange={(event) => setCustomInstituteName(event.target.value)} />
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="">
|
||||||
<label htmlFor="alamat" className="">
|
<label htmlFor="alamat" className="">
|
||||||
|
|
@ -833,8 +832,8 @@ const page = () => {
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
<div className="">
|
<div className="flex flex-col">
|
||||||
<label htmlFor="provinsi">
|
<label htmlFor="provinsi" className="mb-2">
|
||||||
<b>Provinsi</b> <span className="text-red-500">*</span>
|
<b>Provinsi</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<select className={` ${errors.provinsi ? "block" : ""}`} {...register("provinsi")} id="provinsi" name="provinsi" onChange={(event) => getCity(event.target.value)}>
|
<select className={` ${errors.provinsi ? "block" : ""}`} {...register("provinsi")} id="provinsi" name="provinsi" onChange={(event) => getCity(event.target.value)}>
|
||||||
|
|
@ -849,8 +848,8 @@ const page = () => {
|
||||||
</select>
|
</select>
|
||||||
<div className="text-red-500">{errors.provinsi?.message}</div>
|
<div className="text-red-500">{errors.provinsi?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="flex flex-col">
|
||||||
<label htmlFor="kota">
|
<label htmlFor="kota" className="mb-2">
|
||||||
<b>Kota/Kabupaten</b> <span className="text-red-500">*</span>
|
<b>Kota/Kabupaten</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<select className={` ${errors.kota ? "block" : ""}`} {...register("kota")} id="kota" onChange={(event) => getDistricts(event.target.value)}>
|
<select className={` ${errors.kota ? "block" : ""}`} {...register("kota")} id="kota" onChange={(event) => getDistricts(event.target.value)}>
|
||||||
|
|
@ -865,8 +864,8 @@ const page = () => {
|
||||||
</select>
|
</select>
|
||||||
<div className="text-red-500">{errors.kota?.message}</div>
|
<div className="text-red-500">{errors.kota?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="flex flex-col">
|
||||||
<label htmlFor="kecamatan">
|
<label htmlFor="kecamatan" className="mb-2">
|
||||||
<b>Kecamatan</b> <span className="text-red-500">*</span>
|
<b>Kecamatan</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<select className={` ${errors.kecamatan ? "block" : ""}`} {...register("kecamatan")} id="kecamatan">
|
<select className={` ${errors.kecamatan ? "block" : ""}`} {...register("kecamatan")} id="kecamatan">
|
||||||
|
|
@ -881,8 +880,8 @@ const page = () => {
|
||||||
</select>
|
</select>
|
||||||
<div className="text-red-500">{errors.kecamatan?.message}</div>
|
<div className="text-red-500">{errors.kecamatan?.message}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="flex flex-col">
|
||||||
<label htmlFor="password" className="">
|
<label htmlFor="password" className="mb-2">
|
||||||
<b>Kata Sandi</b> <span className="text-red-500">*</span>
|
<b>Kata Sandi</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<Input
|
<Input
|
||||||
|
|
@ -910,11 +909,11 @@ const page = () => {
|
||||||
<Icon icon="fa:eye-slash" />
|
<Icon icon="fa:eye-slash" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="flex flex-col">
|
||||||
<label htmlFor="password" className="">
|
<label htmlFor="password" className="mb-2">
|
||||||
<b>Konfirmasi Kata Sandi</b> <span className="text-red-500">*</span>
|
<b>Konfirmasi Kata Sandi</b> <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<Input
|
||||||
type={typePassConf}
|
type={typePassConf}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
className={` ${errors.passwordConf ? "block" : ""}`}
|
className={` ${errors.passwordConf ? "block" : ""}`}
|
||||||
|
|
@ -982,7 +981,14 @@ const page = () => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={`mb-5 mt-7 w-full text-center flex justify-center ${formProfile == true || stepTwoActive ? "hidden" : ""}`}>
|
<div className={`mb-5 mt-7 w-full text-center flex justify-center ${formProfile == true || stepTwoActive ? "hidden" : ""}`}>
|
||||||
<a className="border cursor-pointer border-red-500 px-4 py-3 rounded-lg text-white bg-[#dc3545] w-full" onClick={() => handleSendOTP()}>
|
{/* <a className="border cursor-pointer border-red-500 px-4 py-3 rounded-lg text-white bg-[#dc3545] w-full" onClick={() => handleSendOTP()}> */}
|
||||||
|
<a
|
||||||
|
className="border cursor-pointer border-red-500 px-4 py-3 rounded-lg text-white bg-[#dc3545] w-[400px]"
|
||||||
|
onClick={() => {
|
||||||
|
setStepOneActive(false);
|
||||||
|
setStepTwoActive(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
Kirim OTP
|
Kirim OTP
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import { Link } from "@/i18n/routing";
|
||||||
import { Reveal } from "./Reveal";
|
import { Reveal } from "./Reveal";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const NewContent = (props: { group: string, type: string }) => {
|
const NewContent = (props: { group: string; type: string }) => {
|
||||||
const [newContent, setNewContent] = useState<any>();
|
const [newContent, setNewContent] = useState<any>();
|
||||||
const [selectedTab, setSelectedTab] = useState("image");
|
const [selectedTab, setSelectedTab] = useState("image");
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -33,10 +33,8 @@ const NewContent = (props: { group: string, type: string }) => {
|
||||||
size: 5,
|
size: 5,
|
||||||
sortBy: props.type == "popular" ? "clickCount" : "createdAt",
|
sortBy: props.type == "popular" ? "clickCount" : "createdAt",
|
||||||
contentTypeId: selectedTab == "image" ? "1" : selectedTab == "video" ? "2" : selectedTab == "text" ? "3" : selectedTab == "audio" ? "4" : "",
|
contentTypeId: selectedTab == "image" ? "1" : selectedTab == "video" ? "2" : selectedTab == "text" ? "3" : selectedTab == "audio" ? "4" : "",
|
||||||
group: props.group == "mabes" ? "" :
|
group: props.group == "mabes" ? "" : props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName : props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-" + satkerName : "",
|
||||||
props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName :
|
isInt: locale == "en" ? true : false,
|
||||||
props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-"+satkerName : "",
|
|
||||||
isInt: locale == "en" ? true : false
|
|
||||||
};
|
};
|
||||||
const response = await getListContent(request);
|
const response = await getListContent(request);
|
||||||
console.log("category", response);
|
console.log("category", response);
|
||||||
|
|
|
||||||
149
lib/menus.ts
149
lib/menus.ts
|
|
@ -2547,7 +2547,7 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
groupLabel: "",
|
groupLabel: "",
|
||||||
id: "media-tracking",
|
id: "media-tracking",
|
||||||
|
|
@ -2712,7 +2712,7 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
} else {
|
} else if (Number(levelNumber) == 2) {
|
||||||
menusSelected = [
|
menusSelected = [
|
||||||
{
|
{
|
||||||
groupLabel: t("apps"),
|
groupLabel: t("apps"),
|
||||||
|
|
@ -2724,53 +2724,11 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
label: t("dashboard"),
|
label: t("dashboard"),
|
||||||
active: pathname.includes("/dashboard"),
|
active: pathname.includes("/dashboard"),
|
||||||
icon: "material-symbols:dashboard",
|
icon: "material-symbols:dashboard",
|
||||||
submenus: [
|
|
||||||
{
|
|
||||||
href: "/dashboard",
|
|
||||||
label: "Breakdown",
|
|
||||||
active: pathname === "/dashboard",
|
|
||||||
icon: "heroicons:arrow-trending-up",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: "/dashboard/executive",
|
|
||||||
label: "Executive",
|
|
||||||
active: pathname === "/dashboard/executive",
|
|
||||||
icon: "heroicons:arrow-trending-up",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
groupLabel: "",
|
|
||||||
id: "agenda-setting",
|
|
||||||
menus: [
|
|
||||||
{
|
|
||||||
id: "agenda-setting",
|
|
||||||
href: "/contributor/agenda-setting",
|
|
||||||
label: t("agenda-setting"),
|
|
||||||
active: pathname.includes("/agenda-setting"),
|
|
||||||
icon: "iconoir:journal-page",
|
|
||||||
submenus: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
groupLabel: "",
|
|
||||||
id: "management-user",
|
|
||||||
menus: [
|
|
||||||
{
|
|
||||||
id: "management-user-menu",
|
|
||||||
href: "/admin/management-user",
|
|
||||||
label: "Management User",
|
|
||||||
active: pathname.includes("/management-user"),
|
|
||||||
icon: "clarity:users-solid",
|
|
||||||
submenus: [],
|
submenus: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
groupLabel: "",
|
groupLabel: "",
|
||||||
id: "content-production",
|
id: "content-production",
|
||||||
|
|
@ -2801,13 +2759,13 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
groupLabel: "",
|
groupLabel: "",
|
||||||
id: "performance-polda",
|
id: "performance-polres",
|
||||||
menus: [
|
menus: [
|
||||||
{
|
{
|
||||||
id: "performance-polda",
|
id: "performance-polres",
|
||||||
href: "/admin/performance-polda",
|
href: "/admin/performance-polres",
|
||||||
label: t("performance-polda"),
|
label: t("performance-polres"),
|
||||||
active: pathname.includes("/admin/performance-polda"),
|
active: pathname.includes("/admin/performance-polres"),
|
||||||
icon: "ant-design:signal-filled",
|
icon: "ant-design:signal-filled",
|
||||||
submenus: [],
|
submenus: [],
|
||||||
},
|
},
|
||||||
|
|
@ -2851,7 +2809,96 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
active: pathname === "/admin/settings/tag",
|
active: pathname === "/admin/settings/tag",
|
||||||
icon: "heroicons:arrow-trending-up",
|
icon: "heroicons:arrow-trending-up",
|
||||||
children: [],
|
children: [],
|
||||||
}
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
menusSelected = [
|
||||||
|
{
|
||||||
|
groupLabel: t("apps"),
|
||||||
|
id: "dashboard",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "dashboard",
|
||||||
|
href: "/dashboard",
|
||||||
|
label: t("dashboard"),
|
||||||
|
active: pathname.includes("/dashboard"),
|
||||||
|
icon: "material-symbols:dashboard",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "content-production",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "content-production",
|
||||||
|
href: "/curator/content-production",
|
||||||
|
label: t("content-production"),
|
||||||
|
active: pathname.includes("/content-production"),
|
||||||
|
icon: "fluent:content-view-gallery-16-regular",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "pattern-relation",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "pattern-relation",
|
||||||
|
href: "/curator/pattern-relation",
|
||||||
|
label: t("pattern-relation"),
|
||||||
|
active: pathname.includes("/pattern-relation"),
|
||||||
|
icon: "oui:app-index-pattern",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "communication",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "communication",
|
||||||
|
href: "/shared/communication",
|
||||||
|
label: t("communication"),
|
||||||
|
active: pathname.includes("/communication"),
|
||||||
|
icon: "token:chat",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "settings",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "settings",
|
||||||
|
href: "/admin/settings",
|
||||||
|
label: t("settings"),
|
||||||
|
active: pathname.includes("/settinng"),
|
||||||
|
icon: "material-symbols:settings",
|
||||||
|
submenus: [
|
||||||
|
{
|
||||||
|
href: "/admin/settings/category",
|
||||||
|
label: t("category"),
|
||||||
|
active: pathname === "/admin/settings/category",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: "/admin/settings/tag",
|
||||||
|
label: "Tag",
|
||||||
|
active: pathname === "/admin/settings/tag",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -296,6 +296,7 @@
|
||||||
"typography": "Typography",
|
"typography": "Typography",
|
||||||
"colors": "Colors",
|
"colors": "Colors",
|
||||||
"performance-polda": "Performance Polda",
|
"performance-polda": "Performance Polda",
|
||||||
|
"performance-polres": "Performance Polres",
|
||||||
"analysis": "Analysis",
|
"analysis": "Analysis",
|
||||||
"management-content": "Content Management ",
|
"management-content": "Content Management ",
|
||||||
"add-experts": "Add Experts",
|
"add-experts": "Add Experts",
|
||||||
|
|
@ -343,7 +344,9 @@
|
||||||
"profile": "Profile",
|
"profile": "Profile",
|
||||||
"contentManagement": "Content Management",
|
"contentManagement": "Content Management",
|
||||||
"live": "Live",
|
"live": "Live",
|
||||||
"notFound": "Not Found"
|
"notFound": "Not Found",
|
||||||
|
"titleSchedule": "Input schedule title",
|
||||||
|
"scheduleToday": ""
|
||||||
},
|
},
|
||||||
"FilterPage": {
|
"FilterPage": {
|
||||||
"image": "Image",
|
"image": "Image",
|
||||||
|
|
|
||||||
|
|
@ -296,6 +296,7 @@
|
||||||
"typography": "Typography",
|
"typography": "Typography",
|
||||||
"colors": "Colors",
|
"colors": "Colors",
|
||||||
"performance-polda": "Performa Polda",
|
"performance-polda": "Performa Polda",
|
||||||
|
"performance-polres": "Performa Polres",
|
||||||
"analysis": "Analisa",
|
"analysis": "Analisa",
|
||||||
"management-content": "Manajemen Konten",
|
"management-content": "Manajemen Konten",
|
||||||
"add-experts": "Tambah Tenaga Ahli",
|
"add-experts": "Tambah Tenaga Ahli",
|
||||||
|
|
@ -343,7 +344,8 @@
|
||||||
"live": "Live",
|
"live": "Live",
|
||||||
"seeLess": "Lihat Lebih Sedikit",
|
"seeLess": "Lihat Lebih Sedikit",
|
||||||
"notFound": "Tidak Ditemukan",
|
"notFound": "Tidak Ditemukan",
|
||||||
"division": "Satker"
|
"division": "Satker",
|
||||||
|
"titleSchedule": "Masukkan judul Jadwal"
|
||||||
},
|
},
|
||||||
"FilterPage": {
|
"FilterPage": {
|
||||||
"image": "Foto",
|
"image": "Foto",
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,13 @@
|
||||||
import qs from "qs";
|
import qs from "qs";
|
||||||
import { getAPIDummy } from "./http-config/axiosCustom";
|
import { getAPIDummy } from "./http-config/axiosCustom";
|
||||||
import { httpGet, httpPost } from "./http-config/http-base-service";
|
import { httpGet, httpPost } from "./http-config/http-base-service";
|
||||||
import {
|
import { httpGetInterceptor, httpGetInterceptorWithToken, httpPostInterceptor } from "./http-config/http-interceptor-service";
|
||||||
httpGetInterceptor,
|
|
||||||
httpGetInterceptorWithToken,
|
|
||||||
httpPostInterceptor,
|
|
||||||
} from "./http-config/http-interceptor-service";
|
|
||||||
|
|
||||||
export async function login(data: any) {
|
export async function login(data: any) {
|
||||||
const pathUrl = "signin";
|
const pathUrl = "signin";
|
||||||
const headers = {
|
const headers = {
|
||||||
'accept': 'application/json',
|
accept: "application/json",
|
||||||
'content-type': 'application/json',
|
"content-type": "application/json",
|
||||||
};
|
};
|
||||||
return httpPost(pathUrl, headers, data);
|
return httpPost(pathUrl, headers, data);
|
||||||
}
|
}
|
||||||
|
|
@ -27,7 +23,7 @@ export async function login(data: any) {
|
||||||
// 'X-XSRF-TOKEN': csrfToken || ''
|
// 'X-XSRF-TOKEN': csrfToken || ''
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// if (!response.ok) {
|
// if (!response.ok) {
|
||||||
// throw new Error(`HTTP error! status: ${response.status}`);
|
// throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
// }
|
// }
|
||||||
|
|
@ -38,18 +34,18 @@ export async function login(data: any) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export async function getCsrfToken() {
|
export async function getCsrfToken() {
|
||||||
const pathUrl = "csrf";
|
const pathUrl = "csrf";
|
||||||
const headers = {
|
const headers = {
|
||||||
'content-type': 'application/json',
|
"content-type": "application/json",
|
||||||
};
|
};
|
||||||
return httpGet(pathUrl, headers);
|
return httpGet(pathUrl, headers);
|
||||||
// const url = 'https://netidhub.com/api/csrf';
|
// const url = 'https://netidhub.com/api/csrf';
|
||||||
// try {
|
// try {
|
||||||
// const response = await fetch(url, {
|
// const response = await fetch(url, {
|
||||||
// method: 'GET',
|
// method: 'GET',
|
||||||
// credentials: 'include'
|
// credentials: 'include'
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// if (!response.ok) {
|
// if (!response.ok) {
|
||||||
// throw new Error(`HTTP error! status: ${response.status}`);
|
// throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
// }
|
// }
|
||||||
|
|
@ -122,10 +118,10 @@ export async function getDataByNRP(reqid: any, nrp: any) {
|
||||||
|
|
||||||
export async function getDataJournalist(cert: any) {
|
export async function getDataJournalist(cert: any) {
|
||||||
const url = `public/users/search-journalist?cert=${cert}`;
|
const url = `public/users/search-journalist?cert=${cert}`;
|
||||||
return httpGetInterceptor({ url });
|
return httpGetInterceptor(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getDataPersonil(nrp: any) {
|
export async function getDataPersonil(nrp: any) {
|
||||||
const url = `public/users/search-personil?nrp=${nrp}`;
|
const url = `public/users/search-personil?nrp=${nrp}`;
|
||||||
return httpGetInterceptor({ url });
|
return httpGetInterceptor(url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue