fixing: bugs in excel
This commit is contained in:
parent
4c32b76ea3
commit
dd94afc81d
|
|
@ -89,15 +89,32 @@ const columns: ColumnDef<any>[] = [
|
|||
const MySwal = withReactContent(Swal);
|
||||
const router = useRouter();
|
||||
const doDelete = async (id: number) => {
|
||||
// Tampilkan loading
|
||||
Swal.fire({
|
||||
title: "Menghapus user...",
|
||||
text: "Mohon tunggu sebentar",
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
},
|
||||
});
|
||||
|
||||
const response = await deleteUser(id);
|
||||
|
||||
if (response?.error) {
|
||||
Swal.close();
|
||||
|
||||
toast({
|
||||
title: stringify(response?.message),
|
||||
variant: "destructive",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Swal.close();
|
||||
|
||||
toast({
|
||||
title: "Success delete",
|
||||
title: "Berhasil menghapus user",
|
||||
});
|
||||
|
||||
router.push("?dataChange=true");
|
||||
|
|
@ -116,6 +133,35 @@ const columns: ColumnDef<any>[] = [
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
// const doDelete = async (id: number) => {
|
||||
// const response = await deleteUser(id);
|
||||
// if (response?.error) {
|
||||
// toast({
|
||||
// title: stringify(response?.message),
|
||||
// variant: "destructive",
|
||||
// });
|
||||
// }
|
||||
// toast({
|
||||
// title: "Success delete",
|
||||
// });
|
||||
|
||||
// router.push("?dataChange=true");
|
||||
// };
|
||||
|
||||
// const handleDelete = (id: number) => {
|
||||
// MySwal.fire({
|
||||
// title: "Apakah anda ingin menghapus data user?",
|
||||
// showCancelButton: true,
|
||||
// confirmButtonColor: "#dc3545",
|
||||
// confirmButtonText: "Iya",
|
||||
// cancelButtonText: "Tidak",
|
||||
// }).then((result) => {
|
||||
// if (result.isConfirmed) {
|
||||
// doDelete(id);
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
|
|
|
|||
|
|
@ -35,32 +35,56 @@ import {
|
|||
import { error, loading } from "@/config/swal";
|
||||
import { Eye, EyeOff } from "lucide-react";
|
||||
|
||||
const FormSchema = z.object({
|
||||
name: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
username: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
password: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
phoneNumber: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
email: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
skills: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
experiences: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
company: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
});
|
||||
// const FormSchema = z.object({
|
||||
// name: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// username: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// password: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// phoneNumber: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// email: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// skills: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// experiences: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// company: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// });
|
||||
|
||||
const FormSchema = z
|
||||
.object({
|
||||
name: z.string({ required_error: "Required" }),
|
||||
username: z.string({ required_error: "Required" }),
|
||||
password: z
|
||||
.string({ required_error: "Required" })
|
||||
.min(8, "Minimal 8 karakter")
|
||||
.regex(/[A-Z]/, "Harus mengandung huruf besar (A-Z)")
|
||||
.regex(/[0-9]/, "Harus mengandung angka (0-9)")
|
||||
.regex(/[^A-Za-z0-9]/, "Harus mengandung karakter spesial (!@#$%^&*)"),
|
||||
|
||||
// confirmPassword: z.string({ required_error: "Required" }),
|
||||
|
||||
phoneNumber: z.string({ required_error: "Required" }),
|
||||
email: z.string({ required_error: "Required" }),
|
||||
skills: z.string({ required_error: "Required" }),
|
||||
experiences: z.string({ required_error: "Required" }),
|
||||
company: z.string({ required_error: "Required" }),
|
||||
})
|
||||
// .refine((data) => data.password === data.confirmPassword, {
|
||||
// path: ["confirmPassword"],
|
||||
// message: "Konfirmasi password tidak sama",
|
||||
// });
|
||||
|
||||
export type Placements = {
|
||||
index: number;
|
||||
|
|
@ -74,6 +98,7 @@ export default function AddExpertForm() {
|
|||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
resolver: zodResolver(FormSchema),
|
||||
});
|
||||
const [passwordStrength, setPasswordStrength] = useState("");
|
||||
const [incrementId, setIncrementId] = useState(1);
|
||||
const [placementRows, setPlacementRows] = useState<Placements[]>([
|
||||
{ index: 0, roleId: "", userLevelId: 0 },
|
||||
|
|
@ -135,7 +160,7 @@ export default function AddExpertForm() {
|
|||
};
|
||||
|
||||
loading();
|
||||
|
||||
|
||||
// check availability first
|
||||
var placementArr: any[] = [];
|
||||
placementRows.forEach((row: any) => {
|
||||
|
|
@ -261,6 +286,19 @@ export default function AddExpertForm() {
|
|||
}
|
||||
};
|
||||
|
||||
const computeStrength = (password: string) => {
|
||||
let score = 0;
|
||||
if (password.length >= 8) score++;
|
||||
if (/[A-Z]/.test(password)) score++;
|
||||
if (/[0-9]/.test(password)) score++;
|
||||
if (/[^A-Za-z0-9]/.test(password)) score++;
|
||||
|
||||
if (score <= 1) return "weak";
|
||||
if (score === 2 || score === 3) return "medium";
|
||||
if (score === 4) return "strong";
|
||||
return "";
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<SiteBreadcrumb />
|
||||
|
|
@ -349,6 +387,66 @@ export default function AddExpertForm() {
|
|||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="password"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Password</FormLabel>
|
||||
<div className="relative">
|
||||
<Input
|
||||
type={showPassword ? "text" : "password"}
|
||||
value={field.value}
|
||||
placeholder="Masukkan Password"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
setPasswordStrength(computeStrength(e.target.value));
|
||||
}}
|
||||
/>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-default-500"
|
||||
>
|
||||
{showPassword ? <EyeOff size={18} /> : <Eye size={18} />}
|
||||
</button>
|
||||
</div>
|
||||
<FormLabel className="text-gray-400 text-[12px]">Password harus memiliki minimal 8 karakter, special karakter, angka dan huruf kapital</FormLabel>
|
||||
|
||||
{/* Strength meter */}
|
||||
{field.value && (
|
||||
<div className="mt-2">
|
||||
<div
|
||||
className={`h-2 rounded transition-all ${
|
||||
passwordStrength === "weak"
|
||||
? "bg-red-500 w-1/4"
|
||||
: passwordStrength === "medium"
|
||||
? "bg-yellow-500 w-2/4"
|
||||
: "bg-green-500 w-full"
|
||||
}`}
|
||||
/>
|
||||
|
||||
<p
|
||||
className={`text-xs mt-1 ${
|
||||
passwordStrength === "weak"
|
||||
? "text-red-500"
|
||||
: passwordStrength === "medium"
|
||||
? "text-yellow-600"
|
||||
: "text-green-600"
|
||||
}`}
|
||||
>
|
||||
{passwordStrength === "weak" && "Weak Password"}
|
||||
{passwordStrength === "medium" && "Medium Password"}
|
||||
{passwordStrength === "strong" && "Strong Password"}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="password"
|
||||
render={({ field }) => (
|
||||
|
|
@ -373,7 +471,7 @@ export default function AddExpertForm() {
|
|||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="skills"
|
||||
|
|
|
|||
|
|
@ -45,27 +45,63 @@ const columns: ColumnDef<any>[] = [
|
|||
cell: ({ row }) => <span>{row.getValue("title")}</span>,
|
||||
},
|
||||
{
|
||||
accessorKey: "link",
|
||||
header: "Jumlah Amplifikasi",
|
||||
cell: ({ row }) => <span>{row.getValue("resultTotal")}</span>,
|
||||
accessorKey: "resultTotal",
|
||||
header: () => <div className="text-center w-full">Jumlah Amplifikasi</div>,
|
||||
cell: ({ row }) => {
|
||||
const value = row.getValue("resultTotal") as number | string | null;
|
||||
|
||||
const finalValue =
|
||||
value === null || value === undefined || value === ""
|
||||
? 0
|
||||
: Number(value);
|
||||
|
||||
return <div className="text-center w-full">{finalValue}</div>;
|
||||
},
|
||||
},
|
||||
|
||||
// {
|
||||
// accessorKey: "status",
|
||||
// header: "Status",
|
||||
// cell: ({ row }) => <span>{row.getValue("status")}</span>,
|
||||
// },
|
||||
// {
|
||||
// accessorKey: "isProcessing",
|
||||
// header: () => <div className="text-center">Status</div>,
|
||||
// cell: ({ row }) => {
|
||||
// const raw = row.getValue("isProcessing");
|
||||
// var status = "Sedang Diproses"
|
||||
// if (Boolean(raw) == true) {
|
||||
// status = "Selesai Diproses";
|
||||
// }
|
||||
// return <div className="text-center">{status}</div>;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
accessorKey: "isProcessing",
|
||||
header: () => <div className="text-center">Status</div>,
|
||||
cell: ({ row }) => {
|
||||
const raw = row.getValue("isProcessing");
|
||||
var status = "Sedang Diproses"
|
||||
if (Boolean(raw) == true) {
|
||||
status = "Selesai Diproses";
|
||||
}
|
||||
return <div className="text-center">{status}</div>;
|
||||
const raw = Boolean(row.getValue("isProcessing"));
|
||||
|
||||
// KONDISI STATUS
|
||||
const statusText = raw ? "Sedang Diproses" : "Sudah Selesai";
|
||||
|
||||
// WARNA STATUS
|
||||
const colorClass = raw
|
||||
? "bg-yellow-100 text-yellow-700 border border-yellow-300"
|
||||
: "bg-green-100 text-green-700 border border-green-300";
|
||||
|
||||
return (
|
||||
<div className="text-center">
|
||||
<span
|
||||
className={`px-2 py-1 rounded text-xs font-medium inline-block ${colorClass}`}
|
||||
>
|
||||
{statusText}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
accessorKey: "createdAt",
|
||||
header: () => <div className="text-center">Tanggal Penarikan</div>,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import * as React from "react";
|
||||
import { ColumnDef } from "@tanstack/react-table";
|
||||
|
||||
import { Eye, MoreVertical, SquarePen, Trash2 } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
|
|
@ -10,13 +8,42 @@ import {
|
|||
DropdownMenuItem,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { format } from "date-fns";
|
||||
import { Link } from "@/components/navigation";
|
||||
import { deleteTicketInternal } from "@/service/communication/communication";
|
||||
import withReactContent from "sweetalert2-react-content";
|
||||
import Swal from "sweetalert2";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
const useTableColumns = () => {
|
||||
const t = useTranslations("Table"); // Panggil di dalam hook
|
||||
const MySwal = withReactContent(Swal);
|
||||
|
||||
const useTableColumns = (onDeleteSuccess?: () => void) => {
|
||||
const t = useTranslations("Table");
|
||||
|
||||
const handleDelete = async (id: any) => {
|
||||
MySwal.fire({
|
||||
title: "Delete Data?",
|
||||
text: "Apakah Anda yakin ingin menghapus data ini?",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Ya, hapus",
|
||||
}).then(async (result) => {
|
||||
if (result.isConfirmed) {
|
||||
try {
|
||||
await deleteTicketInternal(id);
|
||||
|
||||
MySwal.fire("Sukses", "Data berhasil dihapus!", "success");
|
||||
|
||||
if (onDeleteSuccess) onDeleteSuccess();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
MySwal.fire("Gagal", "Terjadi kesalahan saat menghapus", "error");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const columns: ColumnDef<any>[] = [
|
||||
{
|
||||
|
|
@ -67,46 +94,46 @@ const useTableColumns = () => {
|
|||
},
|
||||
{
|
||||
id: "actions",
|
||||
accessorKey: "action",
|
||||
header: t("action", { defaultValue: "Action" }),
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => {
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
size="icon"
|
||||
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||
>
|
||||
<span className="sr-only">Open menu</span>
|
||||
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="p-0" align="end">
|
||||
<Link
|
||||
href={`/shared/communication/internal/detail/${row.original.id}`}
|
||||
>
|
||||
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||
<Eye className="w-4 h-4 me-1.5" />
|
||||
View
|
||||
</DropdownMenuItem>
|
||||
</Link>
|
||||
<Link
|
||||
href={`/shared/communication/internal/update/${row.original.id}`}
|
||||
>
|
||||
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||
<SquarePen className="w-4 h-4 me-1.5" />
|
||||
Edit
|
||||
</DropdownMenuItem>
|
||||
</Link>
|
||||
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||
<Trash2 className="w-4 h-4 me-1.5" />
|
||||
Delete
|
||||
header: t("action"),
|
||||
cell: ({ row }) => (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button size="icon" className="bg-transparent hover:bg-transparent">
|
||||
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="p-0">
|
||||
{/* View */}
|
||||
<Link
|
||||
href={`/shared/communication/internal/detail/${row.original.id}`}
|
||||
>
|
||||
<DropdownMenuItem className="p-2 border-b cursor-pointer hover:bg-slate-100">
|
||||
<Eye className="w-4 h-4 me-1.5" />
|
||||
View
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
);
|
||||
},
|
||||
</Link>
|
||||
|
||||
{/* Edit */}
|
||||
<Link
|
||||
href={`/shared/communication/internal/update/${row.original.id}`}
|
||||
>
|
||||
<DropdownMenuItem className="p-2 border-b cursor-pointer hover:bg-slate-100">
|
||||
<SquarePen className="w-4 h-4 me-1.5" />
|
||||
Edit
|
||||
</DropdownMenuItem>
|
||||
</Link>
|
||||
|
||||
{/* Delete */}
|
||||
<DropdownMenuItem
|
||||
className="p-2 text-destructive bg-destructive/30 cursor-pointer"
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
>
|
||||
<Trash2 className="w-4 h-4 me-1.5" />
|
||||
Delete
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ import useTableColumns from "./columns";
|
|||
const InternalTable = () => {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
const [dataTable, setDataTable] = React.useState<any[]>([]);
|
||||
const [totalData, setTotalData] = React.useState<number>(1);
|
||||
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||
|
|
@ -79,7 +78,6 @@ const InternalTable = () => {
|
|||
React.useState<VisibilityState>({});
|
||||
const [rowSelection, setRowSelection] = React.useState({});
|
||||
const [showData, setShowData] = React.useState("10");
|
||||
|
||||
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||
pageIndex: 0,
|
||||
pageSize: Number(showData),
|
||||
|
|
@ -87,11 +85,7 @@ const InternalTable = () => {
|
|||
const [page, setPage] = React.useState(1);
|
||||
const [totalPage, setTotalPage] = React.useState(1);
|
||||
const [search, setSearch] = React.useState<string>("");
|
||||
const userId = getCookiesDecrypt("uie");
|
||||
const userLevelId = getCookiesDecrypt("ulie");
|
||||
|
||||
const roleId = getCookiesDecrypt("urie");
|
||||
const columns = useTableColumns();
|
||||
const columns = useTableColumns(() => fetchData());
|
||||
const table = useReactTable({
|
||||
data: dataTable,
|
||||
columns,
|
||||
|
|
|
|||
|
|
@ -290,25 +290,29 @@ const Galery = (props: any) => {
|
|||
// toast.success("Link Berhasil Di Copy");
|
||||
};
|
||||
|
||||
async function shareToEmail() {
|
||||
if (Number(userRoleId) < 1 || userRoleId == undefined) {
|
||||
async function shareToEmail(uploadId: any) {
|
||||
if (!userRoleId) {
|
||||
router.push("/auth/login");
|
||||
} else {
|
||||
const data = {
|
||||
mediaUploadId: id?.split("-")?.[0],
|
||||
email: emailShareList || [emailShareInput],
|
||||
message: emailMessageInput,
|
||||
url: window.location.href,
|
||||
};
|
||||
loading();
|
||||
const res = await sendMediaUploadToEmail(data);
|
||||
if (res?.error) {
|
||||
error(res.message);
|
||||
return false;
|
||||
}
|
||||
close();
|
||||
successCallback("Konten Telah Dikirim");
|
||||
return;
|
||||
}
|
||||
|
||||
const data = {
|
||||
mediaUploadId: uploadId, // ← FIX: ID valid dari response
|
||||
email: emailShareList || [emailShareInput],
|
||||
message: emailMessageInput,
|
||||
url: window.location.href,
|
||||
};
|
||||
|
||||
loading();
|
||||
const res = await sendMediaUploadToEmail(data);
|
||||
|
||||
if (res?.error) {
|
||||
error(res.message);
|
||||
return;
|
||||
}
|
||||
|
||||
close();
|
||||
successCallback("Konten Telah Dikirim");
|
||||
}
|
||||
|
||||
const handleEmailList = (e: any) => {
|
||||
|
|
@ -349,12 +353,18 @@ const Galery = (props: any) => {
|
|||
Saya */}
|
||||
{pathname?.split("/")[1] == "in" ? (
|
||||
<>
|
||||
<span className="text-black ">{t("gallery", { defaultValue: "Gallery" })}</span>
|
||||
<span className="text-black ">
|
||||
{t("gallery", { defaultValue: "Gallery" })}
|
||||
</span>
|
||||
|
||||
{t("my", { defaultValue: "My" })}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span className="text-black">{t("my", { defaultValue: "My" })}</span>
|
||||
<span className="text-black">
|
||||
{t("my", { defaultValue: "My" })}
|
||||
</span>
|
||||
|
||||
{t("gallery", { defaultValue: "Gallery" })}
|
||||
</>
|
||||
)}
|
||||
|
|
@ -457,7 +467,9 @@ const Galery = (props: any) => {
|
|||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("save", { defaultValue: "Save" })}{" "}
|
||||
{t("save", {
|
||||
defaultValue: "Save",
|
||||
})}{" "}
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
|
|
@ -481,18 +493,25 @@ const Galery = (props: any) => {
|
|||
fontSize={20}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("share", { defaultValue: "Share" })}{" "}
|
||||
{t("share", {
|
||||
defaultValue: "Share",
|
||||
})}{" "}
|
||||
</p>
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", { defaultValue: "Share To" })}{" "}
|
||||
{t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}{" "}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", { defaultValue: "Destination Email" })}
|
||||
{t("destinationEmail", {
|
||||
defaultValue:
|
||||
"Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
|
|
@ -503,14 +522,22 @@ const Galery = (props: any) => {
|
|||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t("shareTo", { defaultValue: "Share To" })}
|
||||
placeholder={t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() => shareToEmail()}
|
||||
onClick={() =>
|
||||
shareToEmail(
|
||||
video.mediaUploadId
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
{t("send", {
|
||||
defaultValue: "Send",
|
||||
})}
|
||||
</Button>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
|
|
@ -625,10 +652,16 @@ const Galery = (props: any) => {
|
|||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">{t("shareTo", { defaultValue: "Share To" })}</h1>
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", { defaultValue: "Destination Email" })}
|
||||
{t("destinationEmail", {
|
||||
defaultValue: "Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
|
|
@ -637,12 +670,16 @@ const Galery = (props: any) => {
|
|||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t("pressEnter", { defaultValue: "Press Enter" })}
|
||||
placeholder={t("pressEnter", {
|
||||
defaultValue: "Press Enter",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() => shareToEmail()}
|
||||
onClick={() =>
|
||||
shareToEmail(audio.mediaUploadId)
|
||||
}
|
||||
>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
</Button>
|
||||
|
|
@ -732,7 +769,9 @@ const Galery = (props: any) => {
|
|||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("save", { defaultValue: "Save" })}{" "}
|
||||
{t("save", {
|
||||
defaultValue: "Save",
|
||||
})}{" "}
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
|
|
@ -756,18 +795,25 @@ const Galery = (props: any) => {
|
|||
fontSize={20}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("share", { defaultValue: "Share" })}{" "}
|
||||
{t("share", {
|
||||
defaultValue: "Share",
|
||||
})}{" "}
|
||||
</p>
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", { defaultValue: "Share To" })}{" "}
|
||||
{t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}{" "}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", { defaultValue: "Destination Email" })}
|
||||
{t("destinationEmail", {
|
||||
defaultValue:
|
||||
"Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
|
|
@ -778,14 +824,22 @@ const Galery = (props: any) => {
|
|||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t("shareTo", { defaultValue: "Share To" })}
|
||||
placeholder={t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() => shareToEmail()}
|
||||
onClick={() =>
|
||||
shareToEmail(
|
||||
image.mediaUploadId
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
{t("send", {
|
||||
defaultValue: "Send",
|
||||
})}
|
||||
</Button>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
|
|
@ -884,10 +938,14 @@ const Galery = (props: any) => {
|
|||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">{t("shareTo", { defaultValue: "Share To" })}</h1>
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", { defaultValue: "Share To" })}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", { defaultValue: "Destination Email" })}
|
||||
{t("destinationEmail", {
|
||||
defaultValue: "Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
|
|
@ -896,12 +954,16 @@ const Galery = (props: any) => {
|
|||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t("pressEnter", { defaultValue: "Press Enter" })}
|
||||
placeholder={t("pressEnter", {
|
||||
defaultValue: "Press Enter",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() => shareToEmail()}
|
||||
onClick={() =>
|
||||
shareToEmail(document.mediaUploadId)
|
||||
}
|
||||
>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
"use client";
|
||||
|
||||
import { close, error, loading, successCallback } from "@/config/swal";
|
||||
import { checkWishlistStatus, deleteWishlist, getInfoProfile, mediaWishlist, saveWishlist } from "@/service/landing/landing";
|
||||
import {
|
||||
checkWishlistStatus,
|
||||
deleteWishlist,
|
||||
getInfoProfile,
|
||||
mediaWishlist,
|
||||
saveWishlist,
|
||||
} from "@/service/landing/landing";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Link, useRouter } from "@/i18n/routing";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
|
|
@ -13,8 +19,17 @@ import withReactContent from "sweetalert2-react-content";
|
|||
import { getCookiesDecrypt } from "@/lib/utils";
|
||||
import Swal from "sweetalert2";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from "@/components/ui/popover";
|
||||
import { Icon } from "@iconify/react/dist/iconify.js";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
|
@ -61,11 +76,23 @@ const Galery = (props: any) => {
|
|||
}, [page, category, title]);
|
||||
|
||||
async function getDataVideo() {
|
||||
const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || "";
|
||||
const filter =
|
||||
categoryFilter?.length > 0
|
||||
? categoryFilter?.sort().join(",")
|
||||
: category || "";
|
||||
|
||||
const name = title == undefined ? "" : title;
|
||||
const format = formatFilter == undefined ? "" : formatFilter?.join(",");
|
||||
const response = await mediaWishlist("2", isInstitute ? instituteId : "", name, filter, "9", pages, sortBy, format);
|
||||
const response = await mediaWishlist(
|
||||
"2",
|
||||
isInstitute ? instituteId : "",
|
||||
name,
|
||||
filter,
|
||||
"9",
|
||||
pages,
|
||||
sortBy,
|
||||
format
|
||||
);
|
||||
|
||||
setGetTotalPage(response?.data?.data?.totalPages);
|
||||
setContentVideo(response?.data?.data?.content);
|
||||
|
|
@ -94,12 +121,24 @@ const Galery = (props: any) => {
|
|||
}, [page, category, title]);
|
||||
|
||||
async function getDataDocument() {
|
||||
const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || "";
|
||||
const filter =
|
||||
categoryFilter?.length > 0
|
||||
? categoryFilter?.sort().join(",")
|
||||
: category || "";
|
||||
|
||||
const name = title == undefined ? "" : title;
|
||||
const format = formatFilter == undefined ? "" : formatFilter?.join(",");
|
||||
|
||||
const response = await mediaWishlist("3", isInstitute ? instituteId : "", name, filter, "12", pages, sortBy, format);
|
||||
const response = await mediaWishlist(
|
||||
"3",
|
||||
isInstitute ? instituteId : "",
|
||||
name,
|
||||
filter,
|
||||
"12",
|
||||
pages,
|
||||
sortBy,
|
||||
format
|
||||
);
|
||||
|
||||
setGetTotalPage(response?.data?.data?.totalPages);
|
||||
setContentDocument(response?.data?.data?.content);
|
||||
|
|
@ -119,12 +158,24 @@ const Galery = (props: any) => {
|
|||
}, [change, refresh]);
|
||||
|
||||
async function getDataAudio() {
|
||||
const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || "";
|
||||
const filter =
|
||||
categoryFilter?.length > 0
|
||||
? categoryFilter?.sort().join(",")
|
||||
: category || "";
|
||||
|
||||
const name = title == undefined ? "" : title;
|
||||
const format = formatFilter == undefined ? "" : formatFilter?.join(",");
|
||||
|
||||
const response = await mediaWishlist("4", isInstitute ? instituteId : "", name, filter, "6", pages, sortBy, format);
|
||||
const response = await mediaWishlist(
|
||||
"4",
|
||||
isInstitute ? instituteId : "",
|
||||
name,
|
||||
filter,
|
||||
"6",
|
||||
pages,
|
||||
sortBy,
|
||||
format
|
||||
);
|
||||
|
||||
setGetTotalPage(response?.data?.data?.totalPages);
|
||||
setContentAudio(response?.data?.data?.content);
|
||||
|
|
@ -140,12 +191,24 @@ const Galery = (props: any) => {
|
|||
}, [page, category, title, refresh]);
|
||||
|
||||
async function getDataImage() {
|
||||
const filter = categoryFilter?.length > 0 ? categoryFilter?.sort().join(",") : category || "";
|
||||
const filter =
|
||||
categoryFilter?.length > 0
|
||||
? categoryFilter?.sort().join(",")
|
||||
: category || "";
|
||||
|
||||
const name = title == undefined ? "" : title;
|
||||
const format = formatFilter == undefined ? "" : formatFilter?.join(",");
|
||||
|
||||
const response = await mediaWishlist("1", isInstitute ? instituteId : "", name, filter, "12", pages, sortBy, format);
|
||||
const response = await mediaWishlist(
|
||||
"1",
|
||||
isInstitute ? instituteId : "",
|
||||
name,
|
||||
filter,
|
||||
"12",
|
||||
pages,
|
||||
sortBy,
|
||||
format
|
||||
);
|
||||
|
||||
setGetTotalPage(response?.data?.data?.totalPages);
|
||||
setContentImage(response?.data?.data?.content);
|
||||
|
|
@ -227,7 +290,9 @@ const Galery = (props: any) => {
|
|||
};
|
||||
|
||||
const copyToClip = async (url: any) => {
|
||||
await navigator.clipboard.writeText(`https://mediahub.polri.go.id/video/detail/${url}`);
|
||||
await navigator.clipboard.writeText(
|
||||
`https://mediahub.polri.go.id/video/detail/${url}`
|
||||
);
|
||||
setCopySuccess("Copied");
|
||||
// toast.success("Link Berhasil Di Copy");
|
||||
toast({
|
||||
|
|
@ -235,25 +300,29 @@ const Galery = (props: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
async function shareToEmail() {
|
||||
if (Number(userRoleId) < 1 || userRoleId == undefined) {
|
||||
async function shareToEmail(uploadId: any) {
|
||||
if (!userRoleId) {
|
||||
router.push("/auth/login");
|
||||
} else {
|
||||
const data = {
|
||||
mediaUploadId: id?.split("-")?.[0],
|
||||
email: emailShareList || [emailShareInput],
|
||||
message: emailMessageInput,
|
||||
url: window.location.href,
|
||||
};
|
||||
loading();
|
||||
const res = await sendMediaUploadToEmail(data);
|
||||
if (res?.error) {
|
||||
error(res.message);
|
||||
return false;
|
||||
}
|
||||
close();
|
||||
successCallback("Konten Telah Dikirim");
|
||||
return;
|
||||
}
|
||||
|
||||
const data = {
|
||||
mediaUploadId: uploadId, // ← FIX: ID valid dari response
|
||||
email: emailShareList || [emailShareInput],
|
||||
message: emailMessageInput,
|
||||
url: window.location.href,
|
||||
};
|
||||
|
||||
loading();
|
||||
const res = await sendMediaUploadToEmail(data);
|
||||
|
||||
if (res?.error) {
|
||||
error(res.message);
|
||||
return;
|
||||
}
|
||||
|
||||
close();
|
||||
successCallback("Konten Telah Dikirim");
|
||||
}
|
||||
|
||||
const handleEmailList = (e: any) => {
|
||||
|
|
@ -290,7 +359,9 @@ const Galery = (props: any) => {
|
|||
<div className="flex flex-col mt-4">
|
||||
<div className="mx-auto w-full max-w-7xl justify-start flex flex-col gap-5 mb-4">
|
||||
<h1 className="text-2xl w-fit font-bold bg-[#bb3523] px-4 py-1 rounded-lg text-center text-white">
|
||||
<span className="text-black">{t("gallery", { defaultValue: "Gallery" })} </span>
|
||||
<span className="text-black">
|
||||
{t("gallery", { defaultValue: "Gallery" })}{" "}
|
||||
</span>
|
||||
{profile?.institute?.name}
|
||||
</h1>
|
||||
<Tabs value={selectedTab} onValueChange={setSelectedTab}>
|
||||
|
|
@ -301,21 +372,27 @@ const Galery = (props: any) => {
|
|||
>
|
||||
{t("image", { defaultValue: "Image" })}
|
||||
</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"
|
||||
>
|
||||
{t("video", { defaultValue: "Video" })}
|
||||
</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="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"
|
||||
>
|
||||
{t("text", { defaultValue: "Text" })}
|
||||
</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="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"
|
||||
|
|
@ -331,50 +408,140 @@ const Galery = (props: any) => {
|
|||
contentVideo?.length > 0 ? (
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{contentVideo?.map((video: any) => (
|
||||
<Card key={video?.id} className="hover:scale-105 transition-transform duration-300">
|
||||
<Card
|
||||
key={video?.id}
|
||||
className="hover:scale-105 transition-transform duration-300"
|
||||
>
|
||||
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
||||
<div>
|
||||
<div className="relative group overflow-hidden shadow-md hover:shadow-lg">
|
||||
<div className="relative h-60 rounded-lg overflow-hidden">
|
||||
<ImageBlurry src={video?.mediaUpload?.thumbnailLink} alt={video?.mediaUpload?.title} style={{ objectFit: "cover", width: "100%", height: "100%" }} />
|
||||
<ImageBlurry
|
||||
src={video?.mediaUpload?.thumbnailLink}
|
||||
alt={video?.mediaUpload?.title}
|
||||
style={{
|
||||
objectFit: "cover",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
}}
|
||||
/>
|
||||
<div className="absolute bottom-0 left-0 right-0 bg-black text-white">
|
||||
<Link href={`/video/detail/${video?.mediaUpload?.slug}`}>
|
||||
<p className="text-sm p-2 lg:text-base font-semibold truncate">{video?.mediaUpload?.title}</p>
|
||||
<Link
|
||||
href={`/video/detail/${video?.mediaUpload?.slug}`}
|
||||
>
|
||||
<p className="text-sm p-2 lg:text-base font-semibold truncate">
|
||||
{video?.mediaUpload?.title}
|
||||
</p>
|
||||
</Link>
|
||||
<p className="flex text-[10px] mr-1 mb-2 items-center justify-end self-end">
|
||||
<Popover>
|
||||
<PopoverTrigger className="flex cursor-pointer" asChild>
|
||||
<PopoverTrigger
|
||||
className="flex cursor-pointer"
|
||||
asChild
|
||||
>
|
||||
<a className="flex justify-end items-center">
|
||||
<Icon className="text-white ml-1" fontSize={25} icon="tabler:dots" />
|
||||
<Icon
|
||||
className="text-white ml-1"
|
||||
fontSize={25}
|
||||
icon="tabler:dots"
|
||||
/>
|
||||
</a>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-52">
|
||||
<div onClick={() => handleSaveWishlist(video?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800">
|
||||
<Icon icon="material-symbols:bookmark-outline" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">{t("save", { defaultValue: "Save" })} </p>
|
||||
<div
|
||||
onClick={() =>
|
||||
handleSaveWishlist(
|
||||
video?.mediaUpload?.id
|
||||
)
|
||||
}
|
||||
className="cursor-pointer flex flex-row gap-2 hover:text-red-800"
|
||||
>
|
||||
<Icon
|
||||
icon="material-symbols:bookmark-outline"
|
||||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("save", {
|
||||
defaultValue: "Save",
|
||||
})}{" "}
|
||||
</p>
|
||||
</div>
|
||||
<Link href={`/content-management/rewrite/create/${video?.mediaUpload?.id}`} className="flex flex-row hover:text-red-800 gap-2">
|
||||
<Icon icon="jam:write" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">Content Rewrite</p>
|
||||
<Link
|
||||
href={`/content-management/rewrite/create/${video?.mediaUpload?.id}`}
|
||||
className="flex flex-row hover:text-red-800 gap-2"
|
||||
>
|
||||
<Icon
|
||||
icon="jam:write"
|
||||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
Content Rewrite
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex items-center gap-1 hover:text-red-800 w-full rounded-lg">
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<button className="w-full flex flex-row items-center gap-3">
|
||||
<Icon icon="oi:share" fontSize={20} />
|
||||
<p className="text-base font-semibold mb-1">{t("share", { defaultValue: "Share" })} </p>
|
||||
<Icon
|
||||
icon="oi:share"
|
||||
fontSize={20}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("share", {
|
||||
defaultValue: "Share",
|
||||
})}{" "}
|
||||
</p>
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">{t("shareTo", { defaultValue: "Share To" })} </h1>
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}{" "}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">{t("destinationEmail", { defaultValue: "Destination Email" })}</p>
|
||||
<Input value={emailShareInput} onChange={(event) => setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("shareTo", { defaultValue: "Share To" })} />
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", {
|
||||
defaultValue:
|
||||
"Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
onChange={(event) =>
|
||||
setEmailShareInput(
|
||||
event.target.value
|
||||
)
|
||||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<Button className="bg-blue-500 text-white p-2 w-fit rounded-lg" onClick={() => shareToEmail()}>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() =>
|
||||
shareToEmail(
|
||||
video.mediaUploadId
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("send", {
|
||||
defaultValue: "Send",
|
||||
})}
|
||||
</Button>
|
||||
|
||||
{/* <Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() => shareToEmail()}
|
||||
>
|
||||
{t("send", {
|
||||
defaultValue: "Send",
|
||||
})}
|
||||
</Button> */}
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
|
|
@ -392,33 +559,64 @@ const Galery = (props: any) => {
|
|||
</div>
|
||||
) : (
|
||||
<p className="flex items-center justify-center">
|
||||
<Image width={1920} height={1080} src="/assets/empty-data.png" alt="empty" className="h-52 w-52 my-4" />
|
||||
<Image
|
||||
width={1920}
|
||||
height={1080}
|
||||
src="/assets/empty-data.png"
|
||||
alt="empty"
|
||||
className="h-52 w-52 my-4"
|
||||
/>
|
||||
</p>
|
||||
)
|
||||
) : selectedTab == "audio" ? (
|
||||
contentAudio?.length > 0 ? (
|
||||
<div className=" grid grid-cols-1 gap-6 ">
|
||||
{contentAudio?.map((audio: any) => (
|
||||
<div key={audio?.id} className="flex flex-col sm:flex-row items-center bg-white dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full">
|
||||
<div
|
||||
key={audio?.id}
|
||||
className="flex flex-col sm:flex-row items-center bg-white dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full"
|
||||
>
|
||||
<div className="flex items-center justify-center bg-red-500 text-white rounded-lg w-16 h-8 lg:h-16">
|
||||
<svg width="32" height="34" viewBox="0 0 32 34" fill="null" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
width="32"
|
||||
height="34"
|
||||
viewBox="0 0 32 34"
|
||||
fill="null"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M23.404 0.452014C23.7033 0.35857 24.0204 0.336816 24.3297 0.388509C24.639 0.440203 24.9318 0.563895 25.1845 0.749599C25.4371 0.935304 25.6426 1.17782 25.7843 1.45756C25.9259 1.73731 25.9998 2.04644 26 2.36001V14.414C25.3462 14.2296 24.6766 14.1064 24 14.046V8.36001L10 12.736V27C10 28.1264 9.6197 29.2197 8.92071 30.1029C8.22172 30.9861 7.24499 31.6075 6.14877 31.8663C5.05255 32.125 3.90107 32.0061 2.88089 31.5287C1.86071 31.0514 1.03159 30.2435 0.52787 29.2361C0.024152 28.2286 -0.124656 27.0806 0.105556 25.9781C0.335768 24.8755 0.931513 23.883 1.79627 23.1613C2.66102 22.4396 3.74413 22.031 4.87009 22.0017C5.99606 21.9724 7.09893 22.3242 8.00001 23V6.73601C7.99982 6.30956 8.13596 5.8942 8.38854 5.55059C8.64112 5.20698 8.99692 4.9531 9.40401 4.82601L23.404 0.452014ZM10 10.64L24 6.26601V2.36001L10 6.73601V10.64ZM5.00001 24C4.20436 24 3.44129 24.3161 2.87869 24.8787C2.31608 25.4413 2.00001 26.2044 2.00001 27C2.00001 27.7957 2.31608 28.5587 2.87869 29.1213C3.44129 29.6839 4.20436 30 5.00001 30C5.79566 30 6.55872 29.6839 7.12133 29.1213C7.68394 28.5587 8.00001 27.7957 8.00001 27C8.00001 26.2044 7.68394 25.4413 7.12133 24.8787C6.55872 24.3161 5.79566 24 5.00001 24ZM32 25C32 27.387 31.0518 29.6761 29.364 31.364C27.6761 33.0518 25.387 34 23 34C20.6131 34 18.3239 33.0518 16.636 31.364C14.9482 29.6761 14 27.387 14 25C14 22.6131 14.9482 20.3239 16.636 18.6361C18.3239 16.9482 20.6131 16 23 16C25.387 16 27.6761 16.9482 29.364 18.6361C31.0518 20.3239 32 22.6131 32 25ZM27.47 24.128L21.482 20.828C21.3298 20.7443 21.1583 20.7016 20.9846 20.7043C20.8108 20.707 20.6408 20.7549 20.4912 20.8433C20.3416 20.9317 20.2176 21.0576 20.1315 21.2086C20.0453 21.3595 20 21.5302 20 21.704V28.304C20 28.4778 20.0453 28.6486 20.1315 28.7995C20.2176 28.9504 20.3416 29.0763 20.4912 29.1647C20.6408 29.2531 20.8108 29.301 20.9846 29.3037C21.1583 29.3064 21.3298 29.2638 21.482 29.18L27.47 25.88C27.6268 25.7937 27.7575 25.6669 27.8486 25.5128C27.9397 25.3587 27.9877 25.183 27.9877 25.004C27.9877 24.825 27.9397 24.6493 27.8486 24.4952C27.7575 24.3412 27.6268 24.2143 27.47 24.128Z"
|
||||
fill="white"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<Link href={`/audio/detail/${audio?.mediaUpload?.slug}`} className="flex flex-col flex-1">
|
||||
<div className="font-semibold text-gray-900 dark:text-white mt-1 text-sm">{audio?.mediaUpload?.title}</div>
|
||||
<Link
|
||||
href={`/audio/detail/${audio?.mediaUpload?.slug}`}
|
||||
className="flex flex-col flex-1"
|
||||
>
|
||||
<div className="font-semibold text-gray-900 dark:text-white mt-1 text-sm">
|
||||
{audio?.mediaUpload?.title}
|
||||
</div>
|
||||
</Link>
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<div className="mt-2">
|
||||
<img src="/assets/wave.svg" className="w-80" />
|
||||
</div>
|
||||
<div className="flex flex-row items-center justify-center text-gray-500 dark:text-gray-400">
|
||||
<img src="/assets/audio-icon.png" alt="#" className="flex items-center justify-center" />
|
||||
<div className="flex mx-2 items-center justify-center">{audio?.mediaUpload?.duration}</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<img
|
||||
src="/assets/audio-icon.png"
|
||||
alt="#"
|
||||
className="flex items-center justify-center"
|
||||
/>
|
||||
<div className="flex mx-2 items-center justify-center">
|
||||
{audio?.mediaUpload?.duration}
|
||||
</div>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
fill="#f00"
|
||||
d="M7.707 10.293a1 1 0 1 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0l3-3a1 1 0 0 0-1.414-1.414L11 11.586V6h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5v5.586zM9 4a1 1 0 0 1 2 0v2H9z"
|
||||
|
|
@ -427,38 +625,92 @@ const Galery = (props: any) => {
|
|||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<Icon className="text-white ml-1" fontSize={25} icon="tabler:dots" />
|
||||
<Icon
|
||||
className="text-white ml-1"
|
||||
fontSize={25}
|
||||
icon="tabler:dots"
|
||||
/>
|
||||
</a>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-52">
|
||||
<div onClick={() => handleSaveWishlist(audio?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800">
|
||||
<Icon icon="material-symbols:bookmark-outline" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">{t("save", { defaultValue: "Save" })}</p>
|
||||
<div
|
||||
onClick={() =>
|
||||
handleSaveWishlist(audio?.mediaUpload?.id)
|
||||
}
|
||||
className="cursor-pointer flex flex-row gap-2 hover:text-red-800"
|
||||
>
|
||||
<Icon
|
||||
icon="material-symbols:bookmark-outline"
|
||||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("save", { defaultValue: "Save" })}
|
||||
</p>
|
||||
</div>
|
||||
<Link href={`/content-management/rewrite/create/${audio?.mediaUpload?.id}`} className="flex flex-row hover:text-red-800 gap-2">
|
||||
<Link
|
||||
href={`/content-management/rewrite/create/${audio?.mediaUpload?.id}`}
|
||||
className="flex flex-row hover:text-red-800 gap-2"
|
||||
>
|
||||
<Icon icon="jam:write" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">Content Rewrite</p>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
Content Rewrite
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex items-center gap-1 hover:text-red-800 w-full rounded-lg">
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<button className="w-full flex items-center gap-2">
|
||||
<Icon icon="oi:share" fontSize={20} />
|
||||
<p className="text-base font-semibold mb-2">{t("share", { defaultValue: "Share" })}</p>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("share", { defaultValue: "Share" })}
|
||||
</p>
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">{t("shareTo", { defaultValue: "Share To" })}</h1>
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">{t("destinationEmail", { defaultValue: "Destination Email" })}</p>
|
||||
<Input value={emailShareInput} onChange={(event) => setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter", { defaultValue: "Press Enter" })} />
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", {
|
||||
defaultValue: "Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
onChange={(event) =>
|
||||
setEmailShareInput(event.target.value)
|
||||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t("pressEnter", {
|
||||
defaultValue: "Press Enter",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<Button className="bg-blue-500 text-white p-2 w-fit rounded-lg" onClick={() => shareToEmail()}>
|
||||
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() =>
|
||||
shareToEmail(audio.mediaUploadId)
|
||||
}
|
||||
>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
</Button>
|
||||
{/* <Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() => shareToEmail()}
|
||||
>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
</Button> */}
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
|
|
@ -470,56 +722,148 @@ const Galery = (props: any) => {
|
|||
</div>
|
||||
) : (
|
||||
<p className="flex items-center justify-center">
|
||||
<Image width={1920} height={1080} src="/assets/empty-data.png" alt="empty" className="h-52 w-52 my-4" />
|
||||
<Image
|
||||
width={1920}
|
||||
height={1080}
|
||||
src="/assets/empty-data.png"
|
||||
alt="empty"
|
||||
className="h-52 w-52 my-4"
|
||||
/>
|
||||
</p>
|
||||
)
|
||||
) : selectedTab == "image" ? (
|
||||
contentImage?.length > 0 ? (
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{contentImage?.map((image: any) => (
|
||||
<Card key={image?.id} className="hover:scale-105 transition-transform duration-300">
|
||||
<Card
|
||||
key={image?.id}
|
||||
className="hover:scale-105 transition-transform duration-300"
|
||||
>
|
||||
<CardContent className="flex flex-col text-xs lg:text-sm w-full p-0">
|
||||
<div>
|
||||
<div className="relative group overflow-hidden shadow-md hover:shadow-lg">
|
||||
<div className="relative h-60 rounded-lg overflow-hidden">
|
||||
<ImageBlurry src={image?.mediaUpload?.thumbnailLink} alt={image?.mediaUpload?.title} style={{ objectFit: "cover", width: "100%", height: "100%" }} />
|
||||
<ImageBlurry
|
||||
src={image?.mediaUpload?.thumbnailLink}
|
||||
alt={image?.mediaUpload?.title}
|
||||
style={{
|
||||
objectFit: "cover",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
}}
|
||||
/>
|
||||
<div className="absolute bottom-0 left-0 right-0 bg-black text-white">
|
||||
<Link href={`/video/detail/${image?.mediaUpload?.slug}`}>
|
||||
<p className="text-sm p-2 lg:text-base font-semibold truncate">{image?.mediaUpload?.title}</p>
|
||||
<Link
|
||||
href={`/video/detail/${image?.mediaUpload?.slug}`}
|
||||
>
|
||||
<p className="text-sm p-2 lg:text-base font-semibold truncate">
|
||||
{image?.mediaUpload?.title}
|
||||
</p>
|
||||
</Link>
|
||||
<p className="flex text-[10px] mr-1 mb-2 items-center justify-end self-end">
|
||||
<Popover>
|
||||
<PopoverTrigger className="flex cursor-pointer" asChild>
|
||||
<PopoverTrigger
|
||||
className="flex cursor-pointer"
|
||||
asChild
|
||||
>
|
||||
<a className="flex justify-end items-end place-items-end">
|
||||
<Icon className="text-white ml-1" fontSize={25} icon="tabler:dots" />
|
||||
<Icon
|
||||
className="text-white ml-1"
|
||||
fontSize={25}
|
||||
icon="tabler:dots"
|
||||
/>
|
||||
</a>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-52">
|
||||
<div onClick={() => handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800">
|
||||
<Icon icon="material-symbols:bookmark-outline" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">{t("save", { defaultValue: "Save" })}</p>
|
||||
<div
|
||||
onClick={() =>
|
||||
handleSaveWishlist(
|
||||
image?.mediaUpload?.id
|
||||
)
|
||||
}
|
||||
className="cursor-pointer flex flex-row gap-2 hover:text-red-800"
|
||||
>
|
||||
<Icon
|
||||
icon="material-symbols:bookmark-outline"
|
||||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("save", {
|
||||
defaultValue: "Save",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
<Link href={`/content-management/rewrite/create/${image?.mediaUpload?.id}`} className="flex flex-row hover:text-red-800 gap-2">
|
||||
<Icon icon="jam:write" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">Content Rewrite</p>
|
||||
<Link
|
||||
href={`/content-management/rewrite/create/${image?.mediaUpload?.id}`}
|
||||
className="flex flex-row hover:text-red-800 gap-2"
|
||||
>
|
||||
<Icon
|
||||
icon="jam:write"
|
||||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
Content Rewrite
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex items-center gap-1 hover:text-red-800 w-full rounded-lg">
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<button className="w-full flex flex-row items-center gap-3">
|
||||
<Icon icon="oi:share" fontSize={20} />
|
||||
<p className="text-base font-semibold mb-1"> {t("share", { defaultValue: "Share" })}</p>
|
||||
<Icon
|
||||
icon="oi:share"
|
||||
fontSize={20}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{" "}
|
||||
{t("share", {
|
||||
defaultValue: "Share",
|
||||
})}
|
||||
</p>
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">{t("shareTo", { defaultValue: "Share To" })}</h1>
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", {
|
||||
defaultValue: "Share To",
|
||||
})}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">{t("destinationEmail", { defaultValue: "Destination Email" })}</p>
|
||||
<Input value={emailShareInput} onChange={(event) => setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter", { defaultValue: "Press Enter" })} />
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", {
|
||||
defaultValue:
|
||||
"Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
onChange={(event) =>
|
||||
setEmailShareInput(
|
||||
event.target.value
|
||||
)
|
||||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t(
|
||||
"pressEnter",
|
||||
{
|
||||
defaultValue:
|
||||
"Press Enter",
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<Button className="bg-blue-500 text-white p-2 w-fit rounded-lg" onClick={() => shareToEmail()}>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() =>
|
||||
shareToEmail(
|
||||
image.mediaUploadId
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("send", {
|
||||
defaultValue: "Send",
|
||||
})}
|
||||
</Button>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
|
|
@ -538,15 +882,30 @@ const Galery = (props: any) => {
|
|||
</div>
|
||||
) : (
|
||||
<p className="flex items-center justify-center">
|
||||
<Image width={1920} height={1080} src="/assets/empty-data.png" alt="empty" className="h-52 w-52 my-4" />
|
||||
<Image
|
||||
width={1920}
|
||||
height={1080}
|
||||
src="/assets/empty-data.png"
|
||||
alt="empty"
|
||||
className="h-52 w-52 my-4"
|
||||
/>
|
||||
</p>
|
||||
)
|
||||
) : contentDocument.length > 0 ? (
|
||||
<div className=" grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
{contentDocument?.map((document: any) => (
|
||||
<div key={document?.id} className="flex flex-col bg-yellow-500 sm:flex-row items-center dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full">
|
||||
<div
|
||||
key={document?.id}
|
||||
className="flex flex-col bg-yellow-500 sm:flex-row items-center dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4 w-full"
|
||||
>
|
||||
<div className="flex items-center justify-center rounded-lg w-16 h-16">
|
||||
<svg width="28" height="34" viewBox="0 0 28 34" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
width="28"
|
||||
height="34"
|
||||
viewBox="0 0 28 34"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M5.6665 17.4167C5.6665 17.0851 5.7982 16.7672 6.03262 16.5328C6.26704 16.2984 6.58498 16.1667 6.9165 16.1667C7.24802 16.1667 7.56597 16.2984 7.80039 16.5328C8.03481 16.7672 8.1665 17.0851 8.1665 17.4167C8.1665 17.7482 8.03481 18.0661 7.80039 18.3005C7.56597 18.535 7.24802 18.6667 6.9165 18.6667C6.58498 18.6667 6.26704 18.535 6.03262 18.3005C5.7982 18.0661 5.6665 17.7482 5.6665 17.4167ZM6.9165 21.1667C6.58498 21.1667 6.26704 21.2984 6.03262 21.5328C5.7982 21.7672 5.6665 22.0851 5.6665 22.4167C5.6665 22.7482 5.7982 23.0661 6.03262 23.3005C6.26704 23.535 6.58498 23.6667 6.9165 23.6667C7.24802 23.6667 7.56597 23.535 7.80039 23.3005C8.03481 23.0661 8.1665 22.7482 8.1665 22.4167C8.1665 22.0851 8.03481 21.7672 7.80039 21.5328C7.56597 21.2984 7.24802 21.1667 6.9165 21.1667ZM5.6665 27.4167C5.6665 27.0851 5.7982 26.7672 6.03262 26.5328C6.26704 26.2984 6.58498 26.1667 6.9165 26.1667C7.24802 26.1667 7.56597 26.2984 7.80039 26.5328C8.03481 26.7672 8.1665 27.0851 8.1665 27.4167C8.1665 27.7482 8.03481 28.0661 7.80039 28.3005C7.56597 28.535 7.24802 28.6667 6.9165 28.6667C6.58498 28.6667 6.26704 28.535 6.03262 28.3005C5.7982 28.0661 5.6665 27.7482 5.6665 27.4167ZM11.9165 16.1667C11.585 16.1667 11.267 16.2984 11.0326 16.5328C10.7982 16.7672 10.6665 17.0851 10.6665 17.4167C10.6665 17.7482 10.7982 18.0661 11.0326 18.3005C11.267 18.535 11.585 18.6667 11.9165 18.6667H21.0832C21.4147 18.6667 21.7326 18.535 21.9671 18.3005C22.2015 18.0661 22.3332 17.7482 22.3332 17.4167C22.3332 17.0851 22.2015 16.7672 21.9671 16.5328C21.7326 16.2984 21.4147 16.1667 21.0832 16.1667H11.9165ZM10.6665 22.4167C10.6665 22.0851 10.7982 21.7672 11.0326 21.5328C11.267 21.2984 11.585 21.1667 11.9165 21.1667H21.0832C21.4147 21.1667 21.7326 21.2984 21.9671 21.5328C22.2015 21.7672 22.3332 22.0851 22.3332 22.4167C22.3332 22.7482 22.2015 23.0661 21.9671 23.3005C21.7326 23.535 21.4147 23.6667 21.0832 23.6667H11.9165C11.585 23.6667 11.267 23.535 11.0326 23.3005C10.7982 23.0661 10.6665 22.7482 10.6665 22.4167ZM11.9165 26.1667C11.585 26.1667 11.267 26.2984 11.0326 26.5328C10.7982 26.7672 10.6665 27.0851 10.6665 27.4167C10.6665 27.7482 10.7982 28.0661 11.0326 28.3005C11.267 28.535 11.585 28.6667 11.9165 28.6667H21.0832C21.4147 28.6667 21.7326 28.535 21.9671 28.3005C22.2015 28.0661 22.3332 27.7482 22.3332 27.4167C22.3332 27.0851 22.2015 26.7672 21.9671 26.5328C21.7326 26.2984 21.4147 26.1667 21.0832 26.1667H11.9165ZM26.3565 11.0233L16.6415 1.31C16.6157 1.28605 16.5885 1.26378 16.5598 1.24333C16.5392 1.22742 16.5192 1.21074 16.4998 1.19333C16.3852 1.08512 16.2632 0.984882 16.1348 0.893332C16.0922 0.865802 16.0476 0.841298 16.0015 0.819999L15.9215 0.779999L15.8382 0.731666C15.7482 0.679999 15.6565 0.626665 15.5615 0.586665C15.2296 0.454104 14.8783 0.376423 14.5215 0.356665C14.4885 0.354519 14.4557 0.350625 14.4232 0.344999C14.3779 0.338012 14.3323 0.334114 14.2865 0.333332H3.99984C3.11578 0.333332 2.26794 0.684521 1.64281 1.30964C1.01769 1.93476 0.666504 2.78261 0.666504 3.66667V30.3333C0.666504 31.2174 1.01769 32.0652 1.64281 32.6904C2.26794 33.3155 3.11578 33.6667 3.99984 33.6667H23.9998C24.8839 33.6667 25.7317 33.3155 26.3569 32.6904C26.982 32.0652 27.3332 31.2174 27.3332 30.3333V13.38C27.333 12.496 26.9817 11.6483 26.3565 11.0233ZM24.8332 30.3333C24.8332 30.5543 24.7454 30.7663 24.5891 30.9226C24.4328 31.0789 24.2208 31.1667 23.9998 31.1667H3.99984C3.77882 31.1667 3.56686 31.0789 3.41058 30.9226C3.2543 30.7663 3.1665 30.5543 3.1665 30.3333V3.66667C3.1665 3.44565 3.2543 3.23369 3.41058 3.07741C3.56686 2.92113 3.77882 2.83333 3.99984 2.83333H13.9998V10.3333C13.9998 11.2174 14.351 12.0652 14.9761 12.6904C15.6013 13.3155 16.4491 13.6667 17.3332 13.6667H24.8332V30.3333ZM16.4998 4.70166L22.9632 11.1667H17.3332C17.1122 11.1667 16.9002 11.0789 16.7439 10.9226C16.5876 10.7663 16.4998 10.5543 16.4998 10.3333V4.70166Z"
|
||||
fill="black"
|
||||
|
|
@ -555,47 +914,103 @@ const Galery = (props: any) => {
|
|||
</div>
|
||||
|
||||
<div className="flex flex-col flex-1 gap-2">
|
||||
<Link href={`/document/detail/${document?.mediaUpload?.slug}`} className="font-semibold text-gray-900 dark:text-white mt-1 text-sm">
|
||||
<Link
|
||||
href={`/document/detail/${document?.mediaUpload?.slug}`}
|
||||
className="font-semibold text-gray-900 dark:text-white mt-1 text-sm"
|
||||
>
|
||||
{document?.mediaUpload?.title}
|
||||
</Link>
|
||||
<div className="flex gap-2 items-center text-xs text-red-500 dark:text-red-500">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512">
|
||||
<path fill="#f00" d="M224 30v256h-64l96 128l96-128h-64V30zM32 434v48h448v-48z" />
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="1em"
|
||||
height="1em"
|
||||
viewBox="0 0 512 512"
|
||||
>
|
||||
<path
|
||||
fill="#f00"
|
||||
d="M224 30v256h-64l96 128l96-128h-64V30zM32 434v48h448v-48z"
|
||||
/>
|
||||
</svg>
|
||||
Download {t("document", { defaultValue: "Document" })}
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<Icon className="text-white ml-1" fontSize={25} icon="tabler:dots" />
|
||||
<Icon
|
||||
className="text-white ml-1"
|
||||
fontSize={25}
|
||||
icon="tabler:dots"
|
||||
/>
|
||||
</a>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-52">
|
||||
<div onClick={() => handleSaveWishlist(document?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800">
|
||||
<Icon icon="material-symbols:bookmark-outline" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">{t("save", { defaultValue: "Save" })}</p>
|
||||
<div
|
||||
onClick={() =>
|
||||
handleSaveWishlist(document?.mediaUpload?.id)
|
||||
}
|
||||
className="cursor-pointer flex flex-row gap-2 hover:text-red-800"
|
||||
>
|
||||
<Icon
|
||||
icon="material-symbols:bookmark-outline"
|
||||
fontSize={25}
|
||||
/>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("save", { defaultValue: "Save" })}
|
||||
</p>
|
||||
</div>
|
||||
<Link href={`/content-management/rewrite/create/${document?.mediaUpload?.id}`} className="flex flex-row hover:text-red-800 gap-2">
|
||||
<Link
|
||||
href={`/content-management/rewrite/create/${document?.mediaUpload?.id}`}
|
||||
className="flex flex-row hover:text-red-800 gap-2"
|
||||
>
|
||||
<Icon icon="jam:write" fontSize={25} />
|
||||
<p className="text-base font-semibold mb-2">Content Rewrite</p>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
Content Rewrite
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex items-center gap-1 hover:text-red-800 w-full rounded-lg">
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<button className="w-full flex items-center gap-2">
|
||||
<Icon icon="oi:share" fontSize={20} />
|
||||
<p className="text-base font-semibold mb-2">{t("share", { defaultValue: "Share" })}</p>
|
||||
<p className="text-base font-semibold mb-2">
|
||||
{t("share", { defaultValue: "Share" })}
|
||||
</p>
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="mb-2">{t("shareTo", { defaultValue: "Share To" })}</h1>
|
||||
<h1 className="mb-2">
|
||||
{t("shareTo", { defaultValue: "Share To" })}
|
||||
</h1>
|
||||
<div className="flex flex-col mb-2">
|
||||
<p className="text-base font-semibold mb-1">{t("destinationEmail", { defaultValue: "Destination Email" })}</p>
|
||||
<Input value={emailShareInput} onChange={(event) => setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter", { defaultValue: "Press Enter" })} />
|
||||
<p className="text-base font-semibold mb-1">
|
||||
{t("destinationEmail", {
|
||||
defaultValue: "Destination Email",
|
||||
})}
|
||||
</p>
|
||||
<Input
|
||||
value={emailShareInput}
|
||||
onChange={(event) =>
|
||||
setEmailShareInput(event.target.value)
|
||||
}
|
||||
onKeyPress={handleEmailList}
|
||||
type="email"
|
||||
placeholder={t("pressEnter", {
|
||||
defaultValue: "Press Enter",
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<Button className="bg-blue-500 text-white p-2 w-fit rounded-lg" onClick={() => shareToEmail()}>
|
||||
<Button
|
||||
className="bg-blue-500 text-white p-2 w-fit rounded-lg"
|
||||
onClick={() =>
|
||||
shareToEmail(document?.mediaUploadId)
|
||||
}
|
||||
>
|
||||
{t("send", { defaultValue: "Send" })}
|
||||
</Button>
|
||||
</div>
|
||||
|
|
@ -609,7 +1024,13 @@ const Galery = (props: any) => {
|
|||
</div>
|
||||
) : (
|
||||
<p className="flex items-center justify-center">
|
||||
<Image width={1920} height={1080} src="/assets/empty-data.png" alt="empty" className="h-52 w-52 my-4" />
|
||||
<Image
|
||||
width={1920}
|
||||
height={1080}
|
||||
src="/assets/empty-data.png"
|
||||
alt="empty"
|
||||
className="h-52 w-52 my-4"
|
||||
/>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -731,7 +731,7 @@ export default function FormAudio() {
|
|||
setIsStartUpload(true);
|
||||
setProgressList(progressInfoArr);
|
||||
|
||||
close();
|
||||
// close();
|
||||
// showProgress();
|
||||
files.map(async (item: any, index: number) => {
|
||||
await uploadResumableFile(index, String(id), item, "0");
|
||||
|
|
@ -841,6 +841,8 @@ export default function FormAudio() {
|
|||
}
|
||||
if (counter == progressInfo.length) {
|
||||
setIsStartUpload(false);
|
||||
close();
|
||||
|
||||
// hideProgress();
|
||||
Cookies.remove("idCreate");
|
||||
successSubmit("/in/contributor/content/audio");
|
||||
|
|
|
|||
|
|
@ -684,7 +684,7 @@ export default function FormImage() {
|
|||
setIsStartUpload(true);
|
||||
setProgressList(progressInfoArr);
|
||||
|
||||
close();
|
||||
// close();
|
||||
files.map(async (item: any, index: number) => {
|
||||
await uploadResumableFile(
|
||||
index,
|
||||
|
|
@ -795,6 +795,7 @@ export default function FormImage() {
|
|||
}
|
||||
if (counter == progressInfo.length) {
|
||||
setIsStartUpload(false);
|
||||
close();
|
||||
// hideProgress();
|
||||
Cookies.remove("idCreate");
|
||||
successSubmit("/in/contributor/content/image");
|
||||
|
|
|
|||
|
|
@ -749,7 +749,7 @@ export default function FormTeks() {
|
|||
setIsStartUpload(true);
|
||||
setProgressList(progressInfoArr);
|
||||
|
||||
close();
|
||||
// close();
|
||||
files.map(async (item: any, index: number) => {
|
||||
await uploadResumableFile(
|
||||
index,
|
||||
|
|
@ -861,6 +861,7 @@ export default function FormTeks() {
|
|||
}
|
||||
if (counter == progressInfo.length) {
|
||||
setIsStartUpload(false);
|
||||
close();
|
||||
// hideProgress();
|
||||
Cookies.remove("idCreate");
|
||||
successSubmit("/in/contributor/content/teks");
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import {
|
|||
httpGetInterceptor,
|
||||
httpPostInterceptor,
|
||||
} from "../http-config/http-interceptor-service";
|
||||
import { title } from "process";
|
||||
|
||||
export async function listTicketingInternal(
|
||||
page: number,
|
||||
|
|
@ -16,6 +15,7 @@ export async function listTicketingInternal(
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
export async function getTicketingEscalationPagination(
|
||||
page: number,
|
||||
size: any,
|
||||
|
|
@ -64,6 +64,10 @@ export async function deleteTicket(id: any) {
|
|||
return httpDeleteInterceptor(url, id);
|
||||
}
|
||||
|
||||
export async function deleteTicketInternal(id: number | string) {
|
||||
return await httpDeleteInterceptor(`ticketing/internal?id=${id}`);
|
||||
}
|
||||
|
||||
export async function closeTicket(id: any) {
|
||||
const url = `ticketing/close?id=${id}`;
|
||||
return httpPostInterceptor(url, id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue