diff --git a/Dockerfile b/Dockerfile index 13b638c8..40719c24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,26 @@ -FROM node:21-alpine +FROM node:23.5.0-alpine ENV PORT 3000 +# Install pnpm globally +RUN npm install -g pnpm + # Create app directory RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Installing dependencies -COPY package*.json /usr/src/app/ +COPY package*.json pnpm-lock.yaml* /usr/src/app/ -# RUN npm install --force -RUN npm install -g npm@latest -RUN npm install next --legacy-peer-deps +# Install dependencies using pnpm +RUN pnpm install --frozen-lockfile # Copying source files COPY . /usr/src/app # Building app -RUN npm run build +RUN pnpm run build EXPOSE 3000 # Running the app -CMD "npm" "run" "start" +CMD ["pnpm", "run", "start"] \ No newline at end of file diff --git a/action/auth-action.ts b/action/auth-action.ts index c9024f1f..03c93a23 100644 --- a/action/auth-action.ts +++ b/action/auth-action.ts @@ -1,14 +1,14 @@ 'use server' import { redirect } from "next/navigation"; import { revalidatePath } from "next/cache"; -import {signIn} from "@/lib/auth"; export const loginUser = async (data: any) => { try { - const response = await signIn("credentials", { - email: data.email, - password: data.password, - redirect: false, - }); + const response = undefined; + // await signIn("credentials", { + // email: data.email, + // password: data.password, + // redirect: false, + // }); return response; } catch (error) { throw new Error(error as string); diff --git a/app/[locale]/(protected)/app/chat/layout copy.tsx b/app/[locale]/(protected)/app/chat/layout copy.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/app/chat/layout copy.tsx +++ b/app/[locale]/(protected)/app/chat/layout copy.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/app/email/layout copy.tsx b/app/[locale]/(protected)/app/email/layout copy.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/app/email/layout copy.tsx +++ b/app/[locale]/(protected)/app/email/layout copy.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/app/kanban/layout.tsx b/app/[locale]/(protected)/app/kanban/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/app/kanban/layout.tsx +++ b/app/[locale]/(protected)/app/kanban/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/app/layout.tsx b/app/[locale]/(protected)/app/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/app/layout.tsx +++ b/app/[locale]/(protected)/app/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/blocks/layout.tsx b/app/[locale]/(protected)/blocks/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/blocks/layout.tsx +++ b/app/[locale]/(protected)/blocks/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/changelog/layout.tsx b/app/[locale]/(protected)/changelog/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/changelog/layout.tsx +++ b/app/[locale]/(protected)/changelog/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/charts/appex-charts/layout.tsx b/app/[locale]/(protected)/charts/appex-charts/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/charts/appex-charts/layout.tsx +++ b/app/[locale]/(protected)/charts/appex-charts/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/charts/chart-js/layout.tsx b/app/[locale]/(protected)/charts/chart-js/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/charts/chart-js/layout.tsx +++ b/app/[locale]/(protected)/charts/chart-js/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/charts/layout.tsx b/app/[locale]/(protected)/charts/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/charts/layout.tsx +++ b/app/[locale]/(protected)/charts/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/charts/rechart/layout.tsx b/app/[locale]/(protected)/charts/rechart/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/charts/rechart/layout.tsx +++ b/app/[locale]/(protected)/charts/rechart/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/accordion/layout.tsx b/app/[locale]/(protected)/components/accordion/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/accordion/layout.tsx +++ b/app/[locale]/(protected)/components/accordion/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/alert-dialog/layout.tsx b/app/[locale]/(protected)/components/alert-dialog/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/alert-dialog/layout.tsx +++ b/app/[locale]/(protected)/components/alert-dialog/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/alert/layout.tsx b/app/[locale]/(protected)/components/alert/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/alert/layout.tsx +++ b/app/[locale]/(protected)/components/alert/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/avatar/layout.tsx b/app/[locale]/(protected)/components/avatar/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/avatar/layout.tsx +++ b/app/[locale]/(protected)/components/avatar/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/badge/layout.tsx b/app/[locale]/(protected)/components/badge/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/badge/layout.tsx +++ b/app/[locale]/(protected)/components/badge/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/breadcrumb/layout.tsx b/app/[locale]/(protected)/components/breadcrumb/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/breadcrumb/layout.tsx +++ b/app/[locale]/(protected)/components/breadcrumb/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/button/layout.tsx b/app/[locale]/(protected)/components/button/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/button/layout.tsx +++ b/app/[locale]/(protected)/components/button/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/calendar/layout.tsx b/app/[locale]/(protected)/components/calendar/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/calendar/layout.tsx +++ b/app/[locale]/(protected)/components/calendar/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/card/layout.tsx b/app/[locale]/(protected)/components/card/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/card/layout.tsx +++ b/app/[locale]/(protected)/components/card/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/carousel/layout.tsx b/app/[locale]/(protected)/components/carousel/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/carousel/layout.tsx +++ b/app/[locale]/(protected)/components/carousel/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/collapsible/layout.tsx b/app/[locale]/(protected)/components/collapsible/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/collapsible/layout.tsx +++ b/app/[locale]/(protected)/components/collapsible/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/colors/layout.tsx b/app/[locale]/(protected)/components/colors/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/colors/layout.tsx +++ b/app/[locale]/(protected)/components/colors/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/context-menu/layout.tsx b/app/[locale]/(protected)/components/context-menu/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/context-menu/layout.tsx +++ b/app/[locale]/(protected)/components/context-menu/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/dialog/layout.tsx b/app/[locale]/(protected)/components/dialog/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/dialog/layout.tsx +++ b/app/[locale]/(protected)/components/dialog/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/drawer/layout.tsx b/app/[locale]/(protected)/components/drawer/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/drawer/layout.tsx +++ b/app/[locale]/(protected)/components/drawer/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/dropdown/layout.tsx b/app/[locale]/(protected)/components/dropdown/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/dropdown/layout.tsx +++ b/app/[locale]/(protected)/components/dropdown/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/hover-card/layout.tsx b/app/[locale]/(protected)/components/hover-card/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/hover-card/layout.tsx +++ b/app/[locale]/(protected)/components/hover-card/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/menu-bar/layout.tsx b/app/[locale]/(protected)/components/menu-bar/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/menu-bar/layout.tsx +++ b/app/[locale]/(protected)/components/menu-bar/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/navigation-menu/layout.tsx b/app/[locale]/(protected)/components/navigation-menu/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/navigation-menu/layout.tsx +++ b/app/[locale]/(protected)/components/navigation-menu/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/pagination/layout.tsx b/app/[locale]/(protected)/components/pagination/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/pagination/layout.tsx +++ b/app/[locale]/(protected)/components/pagination/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/popover/layout.tsx b/app/[locale]/(protected)/components/popover/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/popover/layout.tsx +++ b/app/[locale]/(protected)/components/popover/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/progress/layout.tsx b/app/[locale]/(protected)/components/progress/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/progress/layout.tsx +++ b/app/[locale]/(protected)/components/progress/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/resizable/layout.tsx b/app/[locale]/(protected)/components/resizable/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/resizable/layout.tsx +++ b/app/[locale]/(protected)/components/resizable/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/scroll-area/layout.tsx b/app/[locale]/(protected)/components/scroll-area/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/scroll-area/layout.tsx +++ b/app/[locale]/(protected)/components/scroll-area/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/separator/layout.tsx b/app/[locale]/(protected)/components/separator/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/separator/layout.tsx +++ b/app/[locale]/(protected)/components/separator/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/sheet/layout.tsx b/app/[locale]/(protected)/components/sheet/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/sheet/layout.tsx +++ b/app/[locale]/(protected)/components/sheet/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/skeleton/layout.tsx b/app/[locale]/(protected)/components/skeleton/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/skeleton/layout.tsx +++ b/app/[locale]/(protected)/components/skeleton/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/sonner/layout.tsx b/app/[locale]/(protected)/components/sonner/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/sonner/layout.tsx +++ b/app/[locale]/(protected)/components/sonner/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/tabs/layout.tsx b/app/[locale]/(protected)/components/tabs/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/tabs/layout.tsx +++ b/app/[locale]/(protected)/components/tabs/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/toast/layout.tsx b/app/[locale]/(protected)/components/toast/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/toast/layout.tsx +++ b/app/[locale]/(protected)/components/toast/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/toggle/layout.tsx b/app/[locale]/(protected)/components/toggle/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/toggle/layout.tsx +++ b/app/[locale]/(protected)/components/toggle/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/tooltip/layout.tsx b/app/[locale]/(protected)/components/tooltip/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/tooltip/layout.tsx +++ b/app/[locale]/(protected)/components/tooltip/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/components/typography/layout.tsx b/app/[locale]/(protected)/components/typography/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/components/typography/layout.tsx +++ b/app/[locale]/(protected)/components/typography/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx index 5157cefb..9618fb74 100644 --- a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx +++ b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx @@ -17,12 +17,15 @@ import { EventContentArg } from "@fullcalendar/core"; import EventModal from "./event-modal"; import { useTranslations } from "next-intl"; import { getAgendaSettingsList } from "@/service/agenda-setting/agenda-setting"; +import dayjs from "dayjs"; const wait = () => new Promise((resolve) => setTimeout(resolve, 1000)); interface CalendarViewProps { events: CalendarEvent[]; categories: CalendarCategory[]; } +const INITIAL_YEAR = dayjs().format("YYYY"); +const INITIAL_MONTH = dayjs().format("M"); export interface CalendarEvent { id: string; title: string; @@ -80,6 +83,18 @@ const CalendarView = ({ events, categories }: CalendarViewProps) => { { title: "Create New theme", id: "104", tag: "etc" }, ]); + useEffect(() => { + getCalendarEvents(); + }); + const getCalendarEvents = async () => { + const res = await getAgendaSettingsList(INITIAL_YEAR, INITIAL_MONTH, ""); + console.log("ress", res); + + if (res.error) { + return false; + } + }; + useEffect(() => { setSelectedCategory(categories?.map((c) => c.value)); }, [events, categories]); @@ -251,14 +266,14 @@ const CalendarView = ({ events, categories }: CalendarViewProps) => { /> -
+ {/*

{t("shortDesc")}

{dragEvents.map((event) => ( ))} -
+
*/}
{t("filter")}
diff --git a/app/[locale]/(protected)/contributor/agenda-setting/data.ts b/app/[locale]/(protected)/contributor/agenda-setting/data.ts index 16e94cee..6b28e1b1 100644 --- a/app/[locale]/(protected)/contributor/agenda-setting/data.ts +++ b/app/[locale]/(protected)/contributor/agenda-setting/data.ts @@ -1,17 +1,31 @@ +import { getAgendaSettingsList } from "@/service/agenda-setting/agenda-setting"; import { faker } from "@faker-js/faker"; +import dayjs from "dayjs"; const date = new Date(); const prevDay = new Date().getDate() - 1; const nextDay = new Date(new Date().getTime() + 24 * 60 * 60 * 1000); +const INITIAL_YEAR = dayjs().format("YYYY"); +const INITIAL_MONTH = dayjs().format("M"); // prettier-ignore const nextMonth = date.getMonth() === 11 ? new Date(date.getFullYear() + 1, 0, 1) : new Date(date.getFullYear(), date.getMonth() + 1, 1) // prettier-ignore const prevMonth = date.getMonth() === 11 ? new Date(date.getFullYear() - 1, 0, 1) : new Date(date.getFullYear(), date.getMonth() - 1, 1) + +export const getCalendarEvents = async () => { + const res = await getAgendaSettingsList(INITIAL_YEAR, INITIAL_MONTH, ""); + if (res.error) { + return false; + } + console.log("ress", res.data.data); + return res?.data?.data; +}; + export const calendarEvents = [ { id: faker.string.uuid(), - title: "All Day Event", + title: "aaaAll Day Event", start: date, end: nextDay, allDay: false, diff --git a/app/[locale]/(protected)/contributor/agenda-setting/utils.ts b/app/[locale]/(protected)/contributor/agenda-setting/utils.ts index e4862dd2..427a2fd9 100644 --- a/app/[locale]/(protected)/contributor/agenda-setting/utils.ts +++ b/app/[locale]/(protected)/contributor/agenda-setting/utils.ts @@ -2,10 +2,10 @@ import { calendarEvents, categories } from "./data"; // get events export const getEvents = async () => { - return calendarEvents; + return calendarEvents; }; // get categories export const getCategories = async () => { - return categories; -} \ No newline at end of file + return categories; +}; diff --git a/app/[locale]/(protected)/contributor/blog/components/columns.tsx b/app/[locale]/(protected)/contributor/blog/components/columns.tsx index c69445ed..3838aaf3 100644 --- a/app/[locale]/(protected)/contributor/blog/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/blog/components/columns.tsx @@ -102,16 +102,16 @@ const columns: ColumnDef[] = [ View - {/* - - - Edit - - + + + + Edit + + Delete - */} + ); diff --git a/app/[locale]/(protected)/contributor/blog/update/[id]/page.tsx b/app/[locale]/(protected)/contributor/blog/update/[id]/page.tsx new file mode 100644 index 00000000..db0bac9d --- /dev/null +++ b/app/[locale]/(protected)/contributor/blog/update/[id]/page.tsx @@ -0,0 +1,15 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import FormBlogUpdate from "@/components/form/blog/blog--update-form"; + +const BlogUpdatePage = async () => { + return ( +
+ +
+ +
+
+ ); +}; + +export default BlogUpdatePage; diff --git a/app/[locale]/(protected)/contributor/content/audio/layout.tsx b/app/[locale]/(protected)/contributor/content/audio/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/contributor/content/audio/layout.tsx +++ b/app/[locale]/(protected)/contributor/content/audio/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/contributor/content/image/components/columns.tsx b/app/[locale]/(protected)/contributor/content/image/components/columns.tsx index 12dd6e04..3704bc4b 100644 --- a/app/[locale]/(protected)/contributor/content/image/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/image/components/columns.tsx @@ -146,6 +146,12 @@ const columns: ColumnDef[] = [ View + + + + Edit + + Delete diff --git a/app/[locale]/(protected)/contributor/content/image/layout.tsx b/app/[locale]/(protected)/contributor/content/image/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/contributor/content/image/layout.tsx +++ b/app/[locale]/(protected)/contributor/content/image/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/contributor/content/image/update/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/image/update/[id]/page.tsx new file mode 100644 index 00000000..1adea644 --- /dev/null +++ b/app/[locale]/(protected)/contributor/content/image/update/[id]/page.tsx @@ -0,0 +1,16 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import FormImageDetail from "@/components/form/content/image-detail-form"; +import FormImageUpdate from "@/components/form/content/image-update-form"; + +const ImageUpdatePage = async () => { + return ( +
+ +
+ +
+
+ ); +}; + +export default ImageUpdatePage; diff --git a/app/[locale]/(protected)/contributor/content/nulis-ai/layout.tsx b/app/[locale]/(protected)/contributor/content/nulis-ai/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/contributor/content/nulis-ai/layout.tsx +++ b/app/[locale]/(protected)/contributor/content/nulis-ai/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/contributor/content/spit/convert/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/spit/convert/[id]/page.tsx new file mode 100644 index 00000000..ed9c8cac --- /dev/null +++ b/app/[locale]/(protected)/contributor/content/spit/convert/[id]/page.tsx @@ -0,0 +1,16 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import FormImageDetail from "@/components/form/content/image-detail-form"; +import FormConvertSPIT from "@/components/form/content/spit-convert-form"; + +const SPITConvertPage = async () => { + return ( +
+ +
+ +
+
+ ); +}; + +export default SPITConvertPage; diff --git a/app/[locale]/(protected)/contributor/content/spit/layout.tsx b/app/[locale]/(protected)/contributor/content/spit/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/contributor/content/spit/layout.tsx +++ b/app/[locale]/(protected)/contributor/content/spit/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/contributor/content/spit/page.tsx b/app/[locale]/(protected)/contributor/content/spit/page.tsx index c87af372..0208103e 100644 --- a/app/[locale]/(protected)/contributor/content/spit/page.tsx +++ b/app/[locale]/(protected)/contributor/content/spit/page.tsx @@ -1,35 +1,24 @@ "use client"; -import { Card, CardContent } from "@/components/ui/card"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import SiteBreadcrumb from "@/components/site-breadcrumb"; -import TableImage from "./table-spit/page"; -import { Newspaper, NewspaperIcon, UploadIcon } from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { Icon } from "@iconify/react/dist/iconify.js"; -import TableSPIT from "./table-spit/page"; +import TableImage from "./table-spit/table-spit"; +import TableSPIT from "./table-spit/table-spit"; const ReactTableSPITPage = () => { return (
- -
-
- Konten SPIT -
- {/*
- - -
*/} -
-
+ + +
+
+ Konten SPIT +
+
+
+
diff --git a/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx b/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx index af464e84..ca5cf595 100644 --- a/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx @@ -1,145 +1,109 @@ "use client"; - import { ColumnDef } from "@tanstack/react-table"; -import { Eye, MoreVertical, SquarePen, Trash2 } from "lucide-react"; - +import { + Eye, + MoreVertical, + MoveDownRight, + SquarePen, + Trash2, +} from "lucide-react"; import { Button } from "@/components/ui/button"; -import { Checkbox } from "@/components/ui/checkbox"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { format } from "date-fns"; +import { Link } from "@/components/navigation"; -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { Badge } from "@/components/ui/badge"; -import { cn } from "@/lib/utils"; -export type DataProps = { - id: string | number; - order: string; - customer: { - name: string; - }; - date: string; - quantity: number; - amount: string; - status: "paid" | "due" | "canceled"; - action: React.ReactNode; -}; -export const columns: ColumnDef[] = [ - // { - // id: "select", - // header: ({ table }) => ( - // table.toggleAllPageRowsSelected(!!value)} - // aria-label="Select all" - // /> - // ), - // cell: ({ row }) => ( - //
- // row.toggleSelected(!!value)} - // aria-label="Select row" - // /> - //
- // ), - // enableSorting: false, - // enableHiding: false, - // }, +const columns: ColumnDef[] = [ { - accessorKey: "id", + accessorKey: "no", header: "No", - cell: ({ row }) => {row.getValue("id")}, - }, - { - accessorKey: "order", - header: "Judul", cell: ({ row }) => ( -
- {row.getValue("order")}, +
+
+

+ {row.getValue("no")} +

+
), }, { - accessorKey: "customer", - header: "Kategory", - cell: ({ row }) => { - const user = row.original.customer; + accessorKey: "contentTitle", + header: "Judul", + cell: ({ row }: { row: { getValue: (key: string) => string } }) => { + const title: string = row.getValue("contentTitle"); return ( -
-
- - {user?.name ?? "Unknown User"} - -
+ + {title.length > 50 ? `${title.slice(0, 30)}...` : title} + + ); + }, + }, + { + accessorKey: "contentTag", + header: "Tag", + cell: ({ row }) => ( + {row.getValue("contentTag")} + ), + }, + + { + accessorKey: "contentType", + header: "Tipe Konten ", + cell: ({ row }) => ( + {row.getValue("contentType")} + ), + }, + { + accessorKey: "contentCreatedGroupBy", + header: "Sumber ", + cell: ({ row }) => ( + + {row.getValue("contentCreatedGroupBy")} + + ), + }, + + { + accessorKey: "isPublish", + header: "Status", + cell: ({ row }) => { + const isPublish = row.getValue("isPublish"); + return ( +
+
); }, }, + { - accessorKey: "date", - header: "Tanggal unggah", + accessorKey: "contentCreatedDate", + header: "Tanggal Unggah", cell: ({ row }) => { - return {row.getValue("date")}; - }, - }, - { - accessorKey: "quantity", - header: "Kreator", - cell: ({ row }) => { - return {row.getValue("quantity")}; - }, - }, - { - accessorKey: "amount", - header: "Sumber", - cell: ({ row }) => { - return {row.getValue("amount")}; - }, - }, - { - accessorKey: "amount", - header: "Penempatan File", - cell: ({ row }) => { - return {row.getValue("amount")}; - }, - }, - { - accessorKey: "status", - header: "Status", - cell: ({ row }) => { - const statusColors: Record = { - paid: "bg-success/20 text-success", - due: "bg-warning/20 text-warning", - canceled: "bg-destructive/20 text-destructive", - }; - const status = row.getValue("status"); - const statusStyles = statusColors[status] || "default"; - return ( - - {status}{" "} - - ); - }, - }, - { - accessorKey: "amount", - header: "Kurasi Konten", - cell: ({ row }) => { - return {row.getValue("amount")}; - }, - }, - { - accessorKey: "amount", - header: "Saran", - cell: ({ row }) => { - return {row.getValue("amount")}; + const createdAt = row.getValue("contentCreatedDate") as + | string + | number + | undefined; + + const formattedDate = + createdAt && !isNaN(new Date(createdAt).getTime()) + ? format(new Date(createdAt), "dd-MM-yyyy HH:mm:ss") + : "-"; + return {formattedDate}; }, }, { @@ -160,21 +124,19 @@ export const columns: ColumnDef[] = [ - - - View - - - - Edit - - - - Delete - + + + + Pindah Ke Mediahub + + ); }, }, ]; + +export default columns; diff --git a/app/[locale]/(protected)/contributor/content/spit/table-spit/data.ts b/app/[locale]/(protected)/contributor/content/spit/table-spit/data.ts deleted file mode 100644 index 99b38b91..00000000 --- a/app/[locale]/(protected)/contributor/content/spit/table-spit/data.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { DataProps } from "./columns"; - -export const data: DataProps[] = [ - { - id: 1, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Liputan Kegiatan", - }, - date: "3/26/2022", - quantity: 13, - amount: "$1779.53", - status: "paid", - action: null, - }, - { - id: 2, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Liputan Kegiatan", - }, - date: "2/6/2022", - quantity: 13, - amount: "$2215.78", - status: "due", - action: null, - }, - { - id: 3, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Liputan Kegiatan", - }, - date: "9/6/2021", - quantity: 1, - amount: "$3183.60", - status: "due", - action: null, - }, - { - id: 4, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Liputan Kegiatan", - }, - date: "11/7/2021", - quantity: 13, - amount: "$2587.86", - status: "canceled", - action: null, - }, - { - id: 5, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Rachel Brown", - }, - date: "5/6/2022", - quantity: 12, - amount: "$3840.73", - status: "paid", - action: null, - }, - { - id: 6, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Megan Taylor", - }, - date: "2/14/2022", - quantity: 12, - amount: "$4764.18", - status: "canceled", - action: null, - }, - { - id: 7, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Sophie Clark", - }, - date: "7/30/2022", - quantity: 6, - amount: "$2875.05", - status: "paid", - action: null, - }, - { - id: 8, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Natalie Martin", - }, - date: "6/30/2022", - quantity: 9, - amount: "$2491.02", - status: "due", - action: null, - }, - { - id: 9, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Hannah Lewis", - }, - date: "8/9/2022", - quantity: 8, - amount: "$3006.95", - status: "due", - action: null, - }, - { - id: 10, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Lisa White", - }, - date: "8/4/2022", - quantity: 12, - amount: "$2160.32", - status: "paid", - action: null, - }, - { - id: 11, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Emma Walker", - }, - date: "4/5/2022", - quantity: 8, - amount: "$1272.66", - status: "paid", - action: null, - }, - { - id: 12, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Jenny Wilson", - }, - date: "8/9/2022", - quantity: 2, - amount: "$4327.86", - status: "canceled", - action: null, - }, - { - id: 13, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Jenny Wilson", - }, - date: "2/10/2022", - quantity: 11, - amount: "$3671.81", - status: "canceled", - action: null, - }, - { - id: 14, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Jenny Wilson", - }, - date: "2/10/2022", - quantity: 2, - amount: "$3401.82", - status: "paid", - action: null, - }, - { - id: 15, - order: "Pertemuan PPID Satker Mabes Polri Langkah Strate", - customer: { - name: "Jenny Wilson", - }, - date: "5/20/2022", - quantity: 4, - amount: "$2387.49", - status: "canceled", - action: null, - }, -]; diff --git a/app/[locale]/(protected)/contributor/content/spit/table-spit/page.tsx b/app/[locale]/(protected)/contributor/content/spit/table-spit/page.tsx deleted file mode 100644 index 8b51bf27..00000000 --- a/app/[locale]/(protected)/contributor/content/spit/table-spit/page.tsx +++ /dev/null @@ -1,383 +0,0 @@ -"use client"; -import * as React from "react"; -import { - ColumnDef, - ColumnFiltersState, - PaginationState, - SortingState, - VisibilityState, - flexRender, - getCoreRowModel, - getFilteredRowModel, - getPaginationRowModel, - getSortedRowModel, - useReactTable, -} from "@tanstack/react-table"; -import { Input } from "@/components/ui/input"; - -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "@/components/ui/table"; - -import { Button } from "@/components/ui/button"; -import { format } from "date-fns"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { - ChevronLeft, - ChevronRight, - Eye, - MoreVertical, - Trash2, -} from "lucide-react"; -import { title } from "process"; - -import { getCookiesDecrypt } from "@/lib/utils"; -import { listSPIT } from "@/service/content/content"; -import { pages } from "next/dist/build/templates/app-page"; - -export type CompanyData = { - no: number; - title: string; - categoryName: string; - createdAt: string; - creatorGroup: string; - publishedOn: string; - isPublish: any; - isPublishOnPolda: any; - isDone: string; -}; - -const columns: ColumnDef[] = [ - { - accessorKey: "no", - header: "No", - cell: ({ row }) => ( -
-
-

- {row.getValue("no")} -

-
-
- ), - }, - { - accessorKey: "title", - header: "Judul", - cell: ({ row }) => ( -
-
-

- {row.getValue("title")} -

-
-
- ), - }, - { - accessorKey: "categoryName", - header: "Kategori", - cell: ({ row }) => ( - {row.getValue("categoryName")} - ), - }, - { - accessorKey: "createdAt", - header: "Tanggal Unggah", - cell: ({ row }) => { - const createdAt = row.getValue("createdAt") as - | string - | number - | undefined; - - const formattedDate = - createdAt && !isNaN(new Date(createdAt).getTime()) - ? format(new Date(createdAt), "dd-MM-yyyy HH:mm:ss") - : "-"; - return {formattedDate}; - }, - }, - { - accessorKey: "creatorGroup", - header: "Sumber ", - cell: ({ row }) => ( - {row.getValue("creatorGroup")} - ), - }, - { - accessorKey: "publishedOn", - header: "Penempatan File", - cell: ({ row }) => { - const isPublish = row.original.isPublish; - const isPublishOnPolda = row.original.isPublishOnPolda; - - let displayText = "-"; - if (isPublish && !isPublishOnPolda) { - displayText = "Mabes"; - } else if (isPublish && isPublishOnPolda) { - displayText = "Mabes & Polda"; - } else if (!isPublish && isPublishOnPolda) { - displayText = "Polda"; - } - - return ( -
- {displayText} -
- ); - }, - }, - - { - accessorKey: "isDone", - header: "Status", - cell: ({ row }) => { - const isDone = row.getValue("isDone"); - return ( -
- -
- ); - }, - }, - { - id: "actions", - accessorKey: "action", - header: "Actions", - enableHiding: false, - cell: ({ row }) => { - return ( - - - - - - - - - View - - - - - Delete - - - - ); - }, - }, -]; - -const TableSPIT = () => { - const [spitTable, setSpitTable] = React.useState([]); - const [sorting, setSorting] = React.useState([]); - const [columnFilters, setColumnFilters] = React.useState( - [] - ); - const [columnVisibility, setColumnVisibility] = - React.useState({}); - const [rowSelection, setRowSelection] = React.useState({}); - const [pagination, setPagination] = React.useState({ - pageIndex: 0, // Halaman pertama - pageSize: 10, // Jumlah baris per halaman - }); - const [page, setPage] = React.useState(1); // Halaman aktif - const [totalPage, setTotalPage] = React.useState(1); // Total halaman - const [limit, setLimit] = React.useState(6); // Jumlah baris per halaman - const [search, setSearch] = React.useState(title); - const userId = getCookiesDecrypt("uie"); - const userLevelId = getCookiesDecrypt("ulie"); - - const [categories, setCategories] = React.useState(); - const [categoryFilter, setCategoryFilter] = React.useState([]); - const [statusFilter, setStatusFilter] = React.useState([1, 2]); - const [startDateString, setStartDateString] = React.useState(""); - const [endDateString, setEndDateString] = React.useState(""); - const [filterByCreator, setFilterByCreator] = React.useState(""); - const [filterBySource, setFilterBySource] = React.useState(""); - - const roleId = getCookiesDecrypt("urie"); - - const table = useReactTable({ - data: spitTable, - columns, - onSortingChange: setSorting, - onColumnFiltersChange: setColumnFilters, - getCoreRowModel: getCoreRowModel(), - getPaginationRowModel: getPaginationRowModel(), - getSortedRowModel: getSortedRowModel(), - getFilteredRowModel: getFilteredRowModel(), - onColumnVisibilityChange: setColumnVisibility, - onRowSelectionChange: setRowSelection, - state: { - sorting, - columnFilters, - columnVisibility, - rowSelection, - }, - }); - - // React.useEffect(() => { - // initState(); - // }, [page, limit]); - - // async function initState() { - // try { - // const isForSelf = Number(roleId) == 4; - - // let isPublish; - // if (statusFilter.length > 1) { - // isPublish = ""; - // } else if (statusFilter.length === 1) { - // if (statusFilter.includes(1)) { - // isPublish = false; - // } else { - // isPublish = true; - // } - // } else { - // isPublish = undefined; - // } - // const res = await listSPIT(pages, limit, search, isPublish); - // const data = res.data.data.content.map((item: any, index: number) => ({ - // no: (page - 1) * limit + index + 1, - // title: item.title, - // categoryName: item.categoryName, - // creatorGroup: item.creatorGroup, - // assignmentType: item.assignmentType?.name || "-", - // createdAt: item.createdAt, - // isDone: item.isDone, - // publishedOn: item.publishedOn, - // isPublish: item.isPublish, - // isPublishOnPolda: item.isPublishOnPolda, - // })); - - // setSpitTable(data); - // setTotalPage(res.data.totalPages); - // } catch (error) { - // console.error("Error fetching tasks:", error); - // } - // } - - return ( -
-
-
- ) => - table.getColumn("status")?.setFilterValue(event.target.value) - } - className="max-w-sm " - /> -
-
- - - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - - - {table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender(cell.column.columnDef.cell, cell.getContext())} - - ))} - - )) - ) : ( - - - No results. - - - )} - -
-
- - {table.getPageOptions().map((page, pageIndex) => ( - - ))} - -
-
- ); -}; -export default TableSPIT; diff --git a/app/[locale]/(protected)/contributor/content/spit/table-spit/table-pagination.tsx b/app/[locale]/(protected)/contributor/content/spit/table-spit/table-pagination.tsx deleted file mode 100644 index ad78cfeb..00000000 --- a/app/[locale]/(protected)/contributor/content/spit/table-spit/table-pagination.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Button } from '@/components/ui/button'; -import { Table } from '@tanstack/react-table'; -import { ChevronLeft, ChevronRight } from 'lucide-react'; - -interface DataTablePaginationProps { - table: Table; -} - -const TablePagination = ({ table }: DataTablePaginationProps) => { - return ( -
-
- {table.getFilteredSelectedRowModel().rows.length} of{" "} - {table.getFilteredRowModel().rows.length} row(s) selected. -
-
- - {table.getPageOptions().map((page, pageIndex) => ( - - - ))} - -
-
- ); -}; - -export default TablePagination; \ No newline at end of file diff --git a/app/[locale]/(protected)/contributor/content/spit/table-spit/table-spit.tsx b/app/[locale]/(protected)/contributor/content/spit/table-spit/table-spit.tsx new file mode 100644 index 00000000..36658412 --- /dev/null +++ b/app/[locale]/(protected)/contributor/content/spit/table-spit/table-spit.tsx @@ -0,0 +1,232 @@ +"use client"; +import * as React from "react"; +import { + ColumnDef, + ColumnFiltersState, + PaginationState, + SortingState, + VisibilityState, + flexRender, + getCoreRowModel, + getFilteredRowModel, + getPaginationRowModel, + getSortedRowModel, + useReactTable, +} from "@tanstack/react-table"; +import { Input } from "@/components/ui/input"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; + +import { Button } from "@/components/ui/button"; +import { + ChevronLeft, + ChevronRight, + Eye, + MoreVertical, + Search, + Trash2, +} from "lucide-react"; +import { title } from "process"; +import { getCookiesDecrypt } from "@/lib/utils"; +import TablePagination from "@/components/table/table-pagination"; +import { listSPIT } from "@/service/content/content"; + +import { useSearchParams } from "next/navigation"; +import { InputGroup, InputGroupText } from "@/components/ui/input-group"; +import columns from "./columns"; + +// export type CompanyData = { +// no: number; +// id: any; +// title: string; +// categoryName: string; +// createdAt: string; +// creatorGroup: string; +// publishedOn: string; +// isPublish: any; +// isPublishOnPolda: any; +// isDone: string; +// }; + +const TableSPIT = () => { + const searchParams = useSearchParams(); + const [spitTable, setSpitTable] = React.useState([]); + const [columnVisibility, setColumnVisibility] = + React.useState({}); + const [rowSelection, setRowSelection] = React.useState({}); + const [pagination, setPagination] = React.useState({ + pageIndex: 0, + pageSize: 10, + }); + const [page, setPage] = React.useState(1); + const [totalPage, setTotalPage] = React.useState(1); + const [limit, setLimit] = React.useState(10); + const [search, setSearch] = React.useState(""); + const userId = getCookiesDecrypt("uie"); + const userLevelId = getCookiesDecrypt("ulie"); + + const [totalData, setTotalData] = React.useState(1); + const [sorting, setSorting] = React.useState([]); + const [columnFilters, setColumnFilters] = React.useState( + [] + ); + const [statusFilter, setStatusFilter] = React.useState([1, 2]); + + const roleId = getCookiesDecrypt("urie"); + + const table = useReactTable({ + data: spitTable, + columns, + onSortingChange: setSorting, + onColumnFiltersChange: setColumnFilters, + getCoreRowModel: getCoreRowModel(), + getPaginationRowModel: getPaginationRowModel(), + getSortedRowModel: getSortedRowModel(), + getFilteredRowModel: getFilteredRowModel(), + onColumnVisibilityChange: setColumnVisibility, + onRowSelectionChange: setRowSelection, + onPaginationChange: setPagination, + state: { + sorting, + columnFilters, + columnVisibility, + rowSelection, + pagination, + }, + }); + + React.useEffect(() => { + const pageFromUrl = searchParams?.get("page"); + if (pageFromUrl) { + setPage(Number(pageFromUrl)); + } + }, [searchParams]); + + React.useEffect(() => { + fetchData(); + }, [page, limit, search]); + + async function fetchData() { + let isPublish; + if (statusFilter.length > 1) { + isPublish = ""; + } else if (statusFilter.length === 1) { + if (statusFilter.includes(1)) { + isPublish = false; + } else { + isPublish = true; + } + } else { + isPublish = undefined; + } + + try { + const res = await listSPIT(page - 1, limit, search, isPublish); + const data = res.data?.data; + const contentData = data?.content; + contentData.forEach((item: any, index: number) => { + item.no = (page - 1) * limit + index + 1; + }); + + console.log("contentData : ", contentData); + + setSpitTable(contentData); + setTotalData(data?.totalElements); + setTotalPage(data?.totalPages); + } catch (error) { + console.error("Error fetching tasks:", error); + } + } + + const handleSearch = (e: React.ChangeEvent) => { + setSearch(e.target.value); // Perbarui state search + table.getColumn("judul")?.setFilterValue(e.target.value); // Set filter tabel + }; + + return ( +
+
+
+ + + + + + +
+
+ ) => + table.getColumn("status")?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
+
+ + + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + No results. + + + )} + +
+ +
+ ); +}; +export default TableSPIT; diff --git a/app/[locale]/(protected)/contributor/content/teks/layout.tsx b/app/[locale]/(protected)/contributor/content/teks/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/contributor/content/teks/layout.tsx +++ b/app/[locale]/(protected)/contributor/content/teks/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/contributor/content/video/layout.tsx b/app/[locale]/(protected)/contributor/content/video/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/contributor/content/video/layout.tsx +++ b/app/[locale]/(protected)/contributor/content/video/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/curator/content-production/layout.tsx b/app/[locale]/(protected)/curator/content-production/layout.tsx new file mode 100644 index 00000000..3534b5a4 --- /dev/null +++ b/app/[locale]/(protected)/curator/content-production/layout.tsx @@ -0,0 +1,9 @@ +export const metadata = { + title: "Content Production", +}; + +const Layout = ({ children }: { children: React.ReactNode }) => { + return <>{children}; +}; + +export default Layout; diff --git a/app/[locale]/(protected)/curator/content-production/page.tsx b/app/[locale]/(protected)/curator/content-production/page.tsx new file mode 100644 index 00000000..e17db212 --- /dev/null +++ b/app/[locale]/(protected)/curator/content-production/page.tsx @@ -0,0 +1,11 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import ContentProductionVisualization from "@/components/visualization/content-production"; + +export default function ContentProduction() { + return ( +
+ + +
+ ); +} diff --git a/app/[locale]/(protected)/curator/pattern-relation/layout.tsx b/app/[locale]/(protected)/curator/pattern-relation/layout.tsx new file mode 100644 index 00000000..c2881520 --- /dev/null +++ b/app/[locale]/(protected)/curator/pattern-relation/layout.tsx @@ -0,0 +1,9 @@ +export const metadata = { + title: "Pattern Relation", +}; + +const Layout = ({ children }: { children: React.ReactNode }) => { + return <>{children}; +}; + +export default Layout; diff --git a/app/[locale]/(protected)/curator/pattern-relation/page.tsx b/app/[locale]/(protected)/curator/pattern-relation/page.tsx new file mode 100644 index 00000000..6bcb42ba --- /dev/null +++ b/app/[locale]/(protected)/curator/pattern-relation/page.tsx @@ -0,0 +1,11 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import PatternRelationVisualization from "@/components/visualization/pattern-relation-viz"; + +export default function PatternRelation() { + return ( +
+ + +
+ ); +} diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/components/columns.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/components/columns.tsx new file mode 100644 index 00000000..d7fd5b5b --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/components/columns.tsx @@ -0,0 +1,75 @@ +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, + DropdownMenuTrigger, + DropdownMenuItem, +} from "@/components/ui/dropdown-menu"; +import { Button } from "@/components/ui/button"; +import { Badge } from "@/components/ui/badge"; +import { htmlToString } from "@/utils/globals"; +import { Link, useRouter } from "@/i18n/routing"; + +const columns: ColumnDef[] = [ + { + accessorKey: "no", + header: "No", + cell: ({ row }) => {row.getValue("no")}, + }, + { + accessorKey: "title", + header: "Judul Perencanaan", + cell: ({ row }) => {row.getValue("title")}, + }, + { + accessorKey: "createdByName", + header: "Nama Pembuat", + cell: ({ row }) => {row.getValue("createdByName")}, + }, + { + accessorKey: "description", + header: "Deskripsi", + cell: ({ row }) => {htmlToString(row.getValue("description"))}, + }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => {row.getValue("status")}, + }, + + { + id: "actions", + accessorKey: "action", + header: "Actions", + enableHiding: false, + cell: ({ row }) => { + return ( + + + + + + + + Detail + + + + + ); + }, + }, +]; + +export default columns; diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/components/table.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/components/table.tsx new file mode 100644 index 00000000..68cd40ee --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/components/table.tsx @@ -0,0 +1,183 @@ +"use client"; + +import * as React from "react"; +import { + ColumnDef, + ColumnFiltersState, + PaginationState, + SortingState, + VisibilityState, + flexRender, + getCoreRowModel, + getFilteredRowModel, + getPaginationRowModel, + getSortedRowModel, + useReactTable, +} from "@tanstack/react-table"; +import { Button } from "@/components/ui/button"; + +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; +import { + ChevronLeft, + ChevronRight, + Eye, + MoreVertical, + Search, + SquarePen, + Trash2, + TrendingDown, + TrendingUp, +} from "lucide-react"; +import { cn } from "@/lib/utils"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { Input } from "@/components/ui/input"; +import { InputGroup, InputGroupText } from "@/components/ui/input-group"; +import { paginationBlog } from "@/service/blog/blog"; +import { ticketingPagination } from "@/service/ticketing/ticketing"; +import { Badge } from "@/components/ui/badge"; +import { useRouter, useSearchParams } from "next/navigation"; +import TablePagination from "@/components/table/table-pagination"; +import columns from "./columns"; + +const TaskPlanMediahubTable = (props: { + data: any; + totalPage: number; + totalData: number; +}) => { + const { data, totalPage, totalData } = props; + const router = useRouter(); + const searchParams = useSearchParams(); + + const [dataTable, setDataTable] = React.useState([]); + // const [totalData, setTotalData] = React.useState(1); + const [sorting, setSorting] = React.useState([]); + const [columnFilters, setColumnFilters] = React.useState( + [] + ); + const [columnVisibility, setColumnVisibility] = + React.useState({}); + const [rowSelection, setRowSelection] = React.useState({}); + const [pagination, setPagination] = React.useState({ + pageIndex: 0, + pageSize: 10, + }); + const [page, setPage] = React.useState(1); + const [limit, setLimit] = React.useState(10); + + const table = useReactTable({ + data: dataTable, + columns, + onSortingChange: setSorting, + onColumnFiltersChange: setColumnFilters, + getCoreRowModel: getCoreRowModel(), + getPaginationRowModel: getPaginationRowModel(), + getSortedRowModel: getSortedRowModel(), + getFilteredRowModel: getFilteredRowModel(), + onColumnVisibilityChange: setColumnVisibility, + onRowSelectionChange: setRowSelection, + onPaginationChange: setPagination, + state: { + sorting, + columnFilters, + columnVisibility, + rowSelection, + pagination, + }, + }); + + React.useEffect(() => { + const pageFromUrl = searchParams?.get("page"); + if (pageFromUrl) { + setPage(Number(pageFromUrl)); + } + }, [searchParams]); + + React.useEffect(() => { + fetchData(); + }, [page, limit, data]); + + async function fetchData() { + // try { + // const res = await ticketingPagination("", limit, page - 1); + // const data = res.data?.data; + console.log("datgaa", data); + const contentData = data; + contentData.forEach((item: any, index: number) => { + item.no = (page - 1) * limit + index + 1; + }); + + console.log("contentData : ", contentData); + + setDataTable(contentData); + // setTotalData(data?.totalElements); + // } catch (error) { + // console.error("Error fetching tasks:", error); + // } + } + + return ( +
+ + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + No results. + + + )} + +
+ +
+ ); +}; + +export default TaskPlanMediahubTable; diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/create-daily/page.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/create-daily/page.tsx new file mode 100644 index 00000000..9ecaeaec --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/create-daily/page.tsx @@ -0,0 +1,436 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { Input } from "@/components/ui/input"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { Link } from "@/i18n/routing"; +import { CalendarIcon } from "lucide-react"; +import React, { useRef, useState } from "react"; +import { cn } from "@/lib/utils"; +import { format } from "date-fns"; +import JoditEditor from "jodit-react"; +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { z } from "zod"; +import { useForm } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; +import { Checkbox } from "@/components/ui/checkbox"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; + +const FormSchema = z.object({ + date: z.date({ + required_error: "Required", + }), + title: z.string({ + required_error: "Required", + }), + detail: z.string({ + required_error: "Required", + }), + output: z.array(z.string()).refine((value) => value.some((item) => item), { + message: "Required", + }), + unit: z.array(z.string()).refine((value) => value.some((item) => item), { + message: "Required", + }), + type: z.enum(["publication", "amplification", "contra"], { + required_error: "Required", + }), +}); + +const items = [ + { + id: "video", + label: "Audio Visual", + }, + { + id: "image", + label: "Foto", + }, + { + id: "audio", + label: "Audio", + }, + { + id: "text", + label: "Text", + }, +]; + +const units = [ + { + id: "mabes", + label: "Mabes Polri", + }, + { + id: "polda", + label: "Polda", + }, + { + id: "polres", + label: "Polres", + }, +]; +export default function CreateMonthly() { + const MySwal = withReactContent(Swal); + + const form = useForm>({ + resolver: zodResolver(FormSchema), + defaultValues: { + unit: [], + output: [], + detail: "", + }, + }); + const editor = useRef(null); + + const onSubmit = async (data: z.infer) => { + console.log("data", data); + if (form.getValues("detail") == "") { + form.setError("detail", { + type: "manual", + message: "Required", + }); + } else { + MySwal.fire({ + title: "Simpan Data", + text: "Apakah Anda yakin ingin menyimpan data ini?", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Simpan", + }).then((result) => { + if (result.isConfirmed) { + save(data); + } + }); + } + }; + + const save = async (data: z.infer) => { + console.log("data", data); + }; + + const output = form.watch("output"); + + const isAllChecked = items.every((item) => output?.includes(item.id)); + + const unit = form.watch("unit"); + + const isAllUnitChecked = units.every((item) => unit?.includes(item.id)); + + const handleAllCheckedChange = (checked: boolean | string) => { + if (checked) { + form.setValue( + "output", + items.map((item) => item.id) + ); + } else { + form.setValue("output", []); + } + }; + + const handleItemCheckedChange = (id: string, checked: boolean | string) => { + form.setValue( + "output", + checked ? [...output, id] : output.filter((value) => value !== id) + ); + }; + + const handleAllUnitCheckedChange = (checked: boolean | string) => { + if (checked) { + form.setValue( + "unit", + units.map((item) => item.id) + ); + } else { + form.setValue("unit", []); + } + }; + + const handleUnitCheckedChange = (id: string, checked: boolean | string) => { + form.setValue( + "unit", + checked ? [...unit, id] : unit.filter((value) => value !== id) + ); + }; + + return ( +
+ +
+
+ + Bulanan + + + Mingguan + + +
+ Harian +
+
+
+

Perencanaan MediaHub

+ +
+ + ( + + Judul Perencanaan + + + + + )} + /> + ( + +
+ Output Tugas +
+
+
+ + handleAllCheckedChange(checked) + } + /> + +
+ + {items.map((item) => ( + { + return ( + + + + handleItemCheckedChange(item.id, checked) + } + /> + + + {item.label} + + + ); + }} + /> + ))} +
+ +
+ )} + /> + ( + +
+ Pelaksana Tugas +
+
+
+ + handleAllUnitCheckedChange(checked) + } + /> + +
+ + {units.map((item) => ( + { + return ( + + + + handleUnitCheckedChange(item.id, checked) + } + /> + + + {item.label} + + + ); + }} + /> + ))} +
+ +
+ )} + /> + ( + + Jenis Penugasan + + + + + + + + Publikasi + + + + + + + + Amplifikasi + + + + + + + Kontra + + + + + + )} + /> + ( + + Pilih Tanggal + + + + + + + + + + + )} + /> + ( + + Detail Perencanaan + + + + + )} + /> +
+ + +
+ + +
+
+
+ ); +} diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/create-monthly/page.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/create-monthly/page.tsx new file mode 100644 index 00000000..a751e2a4 --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/create-monthly/page.tsx @@ -0,0 +1,227 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { Input } from "@/components/ui/input"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { Link, useRouter } from "@/i18n/routing"; +import { CalendarIcon } from "lucide-react"; +import React, { useRef, useState } from "react"; +import { cn } from "@/lib/utils"; +import { format } from "date-fns"; +import JoditEditor from "jodit-react"; +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { z } from "zod"; +import { useForm } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; +import { error } from "@/config/swal"; +import { savePlanning } from "@/service/agenda-setting/agenda-setting"; + +const FormSchema = z.object({ + month: z.date({ + required_error: "Required", + }), + title: z.string({ + required_error: "Required", + }), + detail: z.string({ + required_error: "Required", + }), +}); +export default function CreateMonthly() { + const MySwal = withReactContent(Swal); + const router = useRouter(); + const form = useForm>({ + resolver: zodResolver(FormSchema), + defaultValues: { + detail: "", + }, + }); + const editor = useRef(null); + + const onSubmit = async (data: z.infer) => { + if (form.getValues("detail") == "") { + form.setError("detail", { + type: "manual", + message: "Required", + }); + } else { + MySwal.fire({ + title: "Simpan Data", + text: "Apakah Anda yakin ingin menyimpan data ini?", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Simpan", + }).then((result) => { + if (result.isConfirmed) { + save(data); + } + }); + } + }; + + const save = async (data: z.infer) => { + const reqData = { + planningTypeId: 1, + title: data.title, + time: "3", + description: data.detail, + username: "", + date: new Date(data.month).getMonth() + 1, + status: "Open", + }; + console.log("req", reqData, data.month); + const response = await savePlanning(reqData); + close(); + if (response.error) { + error(response.message); + return false; + } + + MySwal.fire({ + title: "Sukses", + icon: "success", + confirmButtonColor: "#3085d6", + confirmButtonText: "OK", + }).then((result) => { + if (result.isConfirmed) { + router.push("/curator/task-plan/mediahub"); + } + }); + }; + + const handleMonthSelect = (selectedDate: Date | undefined) => { + if (!selectedDate) return; + const newDate = new Date( + selectedDate.getFullYear(), + selectedDate.getMonth(), + 1 + ); + form.setValue("month", newDate); + }; + return ( +
+ +
+
+
+ Bulanan +
+ + Mingguan + + + Harian + +
+
+

Perencanaan MediaHub Bulanan

+ +
+ + ( + + Judul Perencanaan + + + + + )} + /> + ( + + Pilih Bulan + + + + + + + + + + + )} + /> + ( + + Detail Perencanaan + + + + + )} + /> +
+ + +
+ + +
+
+
+ ); +} diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/create-weekly/page.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/create-weekly/page.tsx new file mode 100644 index 00000000..1c6bc2ae --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/create-weekly/page.tsx @@ -0,0 +1,232 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { Input } from "@/components/ui/input"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { Link, useRouter } from "@/i18n/routing"; +import { CalendarIcon } from "lucide-react"; +import React, { useRef, useState } from "react"; +import { cn } from "@/lib/utils"; +import { format } from "date-fns"; +import JoditEditor from "jodit-react"; +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { z } from "zod"; +import { useForm } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; +import { error } from "@/config/swal"; +import { getOnlyDate } from "@/utils/globals"; +import { savePlanning } from "@/service/agenda-setting/agenda-setting"; + +const FormSchema = z.object({ + week: z.object({ + from: z.date({ + required_error: "Start date (from) is required", + }), + to: z.date({ + required_error: "End date (to) is required", + }), + }), + title: z.string({ + required_error: "Required", + }), + detail: z.string({ + required_error: "Required", + }), +}); +export default function CreateMonthly() { + const MySwal = withReactContent(Swal); + const router = useRouter(); + const form = useForm>({ + resolver: zodResolver(FormSchema), + defaultValues: { + detail: "", + }, + }); + const editor = useRef(null); + + const onSubmit = async (data: z.infer) => { + if (form.getValues("detail") == "") { + form.setError("detail", { + type: "manual", + message: "Required", + }); + } else { + MySwal.fire({ + title: "Simpan Data", + text: "Apakah Anda yakin ingin menyimpan data ini?", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Simpan", + }).then((result) => { + if (result.isConfirmed) { + save(data); + } + }); + } + }; + + const save = async (data: z.infer) => { + const reqData = { + planningTypeId: 1, + title: data.title, + time: "2", + description: data.detail, + username: "", + date: `${getOnlyDate(data.week.from)} - ${getOnlyDate(data.week.to)}`, + status: "Open", + }; + console.log("req", reqData); + const response = await savePlanning(reqData); + close(); + if (response.error) { + error(response.message); + return false; + } + + MySwal.fire({ + title: "Sukses", + icon: "success", + confirmButtonColor: "#3085d6", + confirmButtonText: "OK", + }).then((result) => { + if (result.isConfirmed) { + router.push("/curator/task-plan/mediahub"); + } + }); + }; + + return ( +
+ +
+
+ + Bulanan + +
+ Mingguan +
+ + + Harian + +
+
+

Perencanaan MediaHub Mingguan

+ +
+ + ( + + Judul Perencanaan + + + + + )} + /> + ( + + Pilih Tanggal + + + + + + + + + + + )} + /> + ( + + Detail Perencanaan + + + + + )} + /> +
+ + +
+ + +
+
+
+ ); +} diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/detail/[id]/page.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/detail/[id]/page.tsx new file mode 100644 index 00000000..68451be8 --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/detail/[id]/page.tsx @@ -0,0 +1,270 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Checkbox } from "@/components/ui/checkbox"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import { close, loading } from "@/config/swal"; +import { getWeeklyPlanList } from "@/service/agenda-setting/agenda-setting"; +import { getPlanningById } from "@/service/planning/planning"; +import { useParams } from "next/navigation"; +import dayjs from "dayjs"; +import { useEffect, useRef, useState } from "react"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import JoditEditor from "jodit-react"; + +export default function DetailTaskPlanMediahub() { + const params = useParams(); + const id = params?.id; + const editor = useRef(null); + + const [planningData, setPlanningData] = useState(); + + const [type, setType] = useState(""); + + const [weeklyList, setWeeklyList] = useState([]); + const [weeklySelected, setWeeklySelected] = useState(); + + const [taskOutput, setTaskOutput] = useState([]); + const [destination, setDestination] = useState([]); + const [listDest, setListDest] = useState([]); + const [topDestination, setTopDestination] = useState([]); + + useEffect(() => { + initFetch(); + }, [id]); + + async function initFetch() { + if (id != undefined) { + loading(); + const res = await getPlanningById(id); + close(); + + if (res?.data?.data != undefined) { + const data = res?.data?.data; + console.log("Data :", data); + setPlanningData(data); + setAssignedTopLevel(data?.assignedToTopLevel); + setArrayDestination(data?.assignedToLevel); + setArrayTaskOutput(data?.fileTypeOutput); + setType(String(data?.assignmentTypeId)); + } + } + } + + function setArrayDestination(assignedToLevel: any) { + if (assignedToLevel?.length > 0) { + const arrayDestination = []; + const arrayDest = assignedToLevel.split(","); + + for (const element of arrayDest) { + arrayDestination.push(element); + } + + setDestination(arrayDestination); + } + } + + function setAssignedTopLevel(assignedToTopLevel: any) { + if (assignedToTopLevel?.length > 0) { + const arrayTopLevel = []; + const arrayTop = assignedToTopLevel.split(","); + + for (const element of arrayTop) { + arrayTopLevel.push(Number(element)); + } + + setTopDestination(arrayTopLevel); + } + } + + function setArrayTaskOutput(output: any) { + if (output?.length > 0) { + const arrayOutput = []; + const arrOutput = output.split(","); + + for (const element of arrOutput) { + arrayOutput.push(Number(element)); + } + + setTaskOutput(arrayOutput); + } + } + + useEffect(() => { + getWeeklyPlanning(); + }, [planningData]); + + async function getWeeklyPlanning() { + const TODAY = dayjs().format("YYYY-MM-DD"); + const res = await getWeeklyPlanList(planningData?.date || TODAY, 1); + + if (res.data !== null) { + const rawUser = res.data?.data; + const optionArr = rawUser.map((option: any) => ({ + id: option.id, + label: option.title, + value: option.id, + })); + console.log("res", optionArr); + + setWeeklyList(optionArr); + } + } + return ( + <> + +
+

Perencanaan Mediahub

+

Judul Perencanaan

+ +

Output Tugas

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

Pelaksana Tugas

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

Jenis Penugasan

+ +
+ + +
+
+ + +
+
+ + +
+
+

Tanggal

+ +

Penugasan Mingguan

+ + +
+ + ); +} diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/layout.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/layout.tsx new file mode 100644 index 00000000..8ba3fc82 --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/layout.tsx @@ -0,0 +1,9 @@ +export const metadata = { + title: "Mediahub", +}; + +const Layout = ({ children }: { children: React.ReactNode }) => { + return <>{children}; +}; + +export default Layout; diff --git a/app/[locale]/(protected)/curator/task-plan/mediahub/page.tsx b/app/[locale]/(protected)/curator/task-plan/mediahub/page.tsx new file mode 100644 index 00000000..3facc20d --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/mediahub/page.tsx @@ -0,0 +1,37 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import ListViewTable from "@/components/table/task-plan/list-view-table"; +import SingleViewTable from "@/components/table/task-plan/single-view-table"; +import { Button } from "@/components/ui/button"; +import { useRouter } from "@/i18n/routing"; +import { useState } from "react"; + +export default function TaskPlanMediaHub() { + const router = useRouter(); + const [view, setView] = useState("single"); + return ( + <> + +
+
+ + +
+ {view == "single" ? : } +
+ + ); +} diff --git a/app/[locale]/(protected)/curator/task-plan/medsos-mediahub/layout.tsx b/app/[locale]/(protected)/curator/task-plan/medsos-mediahub/layout.tsx new file mode 100644 index 00000000..ebe80adf --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/medsos-mediahub/layout.tsx @@ -0,0 +1,9 @@ +export const metadata = { + title: "Medos Mediahub", +}; + +const Layout = ({ children }: { children: React.ReactNode }) => { + return <>{children}; +}; + +export default Layout; diff --git a/app/[locale]/(protected)/curator/task-plan/medsos-mediahub/page.tsx b/app/[locale]/(protected)/curator/task-plan/medsos-mediahub/page.tsx new file mode 100644 index 00000000..5009e0f2 --- /dev/null +++ b/app/[locale]/(protected)/curator/task-plan/medsos-mediahub/page.tsx @@ -0,0 +1,9 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; + +export default function TaskPlanMedsosMediaHub() { + return ( +
+ +
+ ); +} diff --git a/app/[locale]/(protected)/dashboard/layout.tsx b/app/[locale]/(protected)/dashboard/layout.tsx index 2db12ef5..2a0618ff 100644 --- a/app/[locale]/(protected)/dashboard/layout.tsx +++ b/app/[locale]/(protected)/dashboard/layout.tsx @@ -1,10 +1,9 @@ import PageTitle from "@/components/page-title"; import { Metadata } from "next"; -import { Suspense } from "react"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <> diff --git a/app/[locale]/(protected)/dashboard/page.tsx b/app/[locale]/(protected)/dashboard/page.tsx index 079e6488..89ba710b 100644 --- a/app/[locale]/(protected)/dashboard/page.tsx +++ b/app/[locale]/(protected)/dashboard/page.tsx @@ -1,4 +1,4 @@ -'use client' +"use client"; import { StatisticsBlock } from "@/components/blocks/statistics-block"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; @@ -7,171 +7,181 @@ import { useTranslations } from "next-intl"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Button } from "@/components/ui/button"; import { UploadIcon } from "lucide-react"; + +import Cookies from "js-cookie"; +import { useEffect } from "react"; +import { getCookiesDecrypt } from "@/lib/utils"; +import DashboardVisualization from "@/components/visualization/dashboard-viz"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; import TaskTable from "../contributor/task/components/task-table"; import PressConferenceTable from "../contributor/schedule/press-release/components/pressrilis-table"; import BlogTable from "../contributor/blog/components/blog-table"; import ContentTable from "./routine-task/components/content-table"; import RecentActivity from "./routine-task/components/recent-activity"; import { Link } from "@/components/navigation"; -import { Suspense } from "react"; const DashboardPage = () => { const t = useTranslations("AnalyticsDashboard"); - return ( - -
-
- - - - - Tugas Rutin - - - Penugasan - - - Jadwal - - - Indeks - - - - -
-
- - -
- - - + const roleId = getCookiesDecrypt("urie"); + + return Number(roleId) == 2 || Number(roleId) == 11 || Number(roleId) == 12 ? ( +
+ + +
+ ) : ( +
+
+ + + + + Tugas Rutin + + + Penugasan + + + Jadwal + + + Indeks + + + + +
+
+ + +
+ + + +
+
+
+
+
+
+
+ + + + {"Total Produksi Konten"} + + + + + + + +
+
+ + + {"Table"} + + + + + + +
+
+
+ +
+
+ + +
+
+ Table Penugasan
- - -
-
-
-
- - - - {"Total Produksi Konten"} - - - - - - - -
-
- - - {"Table"} - - - - - - -
-
- - -
-
- - -
-
- Table Penugasan -
-
- - - -
+
+ + +
- - - - +
-
+ + + +
-
- -
-
- - - - - -
+
+
+ +
+
+ + + + +
- - -
-
- - -
-
- Table Indeks -
-
- - - -
+
+ + +
+
+ + +
+
+ Table Indeks
- - - - +
+ + + +
+
-
+ + + +
-
- -
+
+
+
- +
); }; diff --git a/app/[locale]/(protected)/ecommerce/backend/layout.tsx b/app/[locale]/(protected)/ecommerce/backend/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/ecommerce/backend/layout.tsx +++ b/app/[locale]/(protected)/ecommerce/backend/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/ecommerce/layout.tsx b/app/[locale]/(protected)/ecommerce/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/ecommerce/layout.tsx +++ b/app/[locale]/(protected)/ecommerce/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/checkbox/layout.tsx b/app/[locale]/(protected)/forms/checkbox/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/checkbox/layout.tsx +++ b/app/[locale]/(protected)/forms/checkbox/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/combobox/layout.tsx b/app/[locale]/(protected)/forms/combobox/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/combobox/layout.tsx +++ b/app/[locale]/(protected)/forms/combobox/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/command/layout.tsx b/app/[locale]/(protected)/forms/command/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/command/layout.tsx +++ b/app/[locale]/(protected)/forms/command/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/form-validation/layout.tsx b/app/[locale]/(protected)/forms/form-validation/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/form-validation/layout.tsx +++ b/app/[locale]/(protected)/forms/form-validation/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/input-file/layout.tsx b/app/[locale]/(protected)/forms/input-file/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/input-file/layout.tsx +++ b/app/[locale]/(protected)/forms/input-file/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/input-group/layout.tsx b/app/[locale]/(protected)/forms/input-group/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/input-group/layout.tsx +++ b/app/[locale]/(protected)/forms/input-group/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/input-layout/layout.tsx b/app/[locale]/(protected)/forms/input-layout/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/input-layout/layout.tsx +++ b/app/[locale]/(protected)/forms/input-layout/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/input-mask/layout.tsx b/app/[locale]/(protected)/forms/input-mask/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/input-mask/layout.tsx +++ b/app/[locale]/(protected)/forms/input-mask/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/input-otp/layout.tsx b/app/[locale]/(protected)/forms/input-otp/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/input-otp/layout.tsx +++ b/app/[locale]/(protected)/forms/input-otp/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/input/layout.tsx b/app/[locale]/(protected)/forms/input/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/input/layout.tsx +++ b/app/[locale]/(protected)/forms/input/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/layout.tsx b/app/[locale]/(protected)/forms/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/layout.tsx +++ b/app/[locale]/(protected)/forms/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/radio/layout.tsx b/app/[locale]/(protected)/forms/radio/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/radio/layout.tsx +++ b/app/[locale]/(protected)/forms/radio/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/select/layout.tsx b/app/[locale]/(protected)/forms/select/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/select/layout.tsx +++ b/app/[locale]/(protected)/forms/select/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/slider/layout.tsx b/app/[locale]/(protected)/forms/slider/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/slider/layout.tsx +++ b/app/[locale]/(protected)/forms/slider/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/switch/layout.tsx b/app/[locale]/(protected)/forms/switch/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/switch/layout.tsx +++ b/app/[locale]/(protected)/forms/switch/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/forms/textarea/layout.tsx b/app/[locale]/(protected)/forms/textarea/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/forms/textarea/layout.tsx +++ b/app/[locale]/(protected)/forms/textarea/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/icons/layout.tsx b/app/[locale]/(protected)/icons/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/icons/layout.tsx +++ b/app/[locale]/(protected)/icons/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/maps/layout.tsx b/app/[locale]/(protected)/maps/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/maps/layout.tsx +++ b/app/[locale]/(protected)/maps/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx b/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx index ac4e763e..c55f5492 100644 --- a/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx +++ b/app/[locale]/(protected)/shared/communication/internal/components/columns.tsx @@ -105,10 +105,14 @@ const columns: ColumnDef[] = [ View - - - Edit - + + + + Edit + + Delete diff --git a/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx b/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx index 4cba01b0..a9a4862c 100644 --- a/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx +++ b/app/[locale]/(protected)/shared/communication/internal/components/internal-table.tsx @@ -151,7 +151,7 @@ const TableAudio = () => { }; return ( -
+
diff --git a/app/[locale]/(protected)/shared/communication/internal/update/[id]/page.tsx b/app/[locale]/(protected)/shared/communication/internal/update/[id]/page.tsx new file mode 100644 index 00000000..0f2efc81 --- /dev/null +++ b/app/[locale]/(protected)/shared/communication/internal/update/[id]/page.tsx @@ -0,0 +1,19 @@ +import { Card, CardContent } from "@/components/ui/card"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import FormTask from "@/components/form/task/task-form"; +import FormTaskDetail from "@/components/form/task/task-detail-form"; +import FormDetailInternal from "@/components/form/communication/internal-detail-form"; +import FormEditInternal from "@/components/form/communication/internal-edit-form"; + +const InternalUpdatePage = async () => { + return ( +
+ +
+ +
+
+ ); +}; + +export default InternalUpdatePage; diff --git a/app/[locale]/(protected)/shared/communication/page.tsx b/app/[locale]/(protected)/shared/communication/page.tsx index 77104464..bda9d00c 100644 --- a/app/[locale]/(protected)/shared/communication/page.tsx +++ b/app/[locale]/(protected)/shared/communication/page.tsx @@ -11,8 +11,8 @@ const CommunicationPage = () => {
- - + +

Komunikasi

{ Kolaborasi -
- -
-
- - - - - + + +
+
+ + + + + +
-
- - -
-
- - - - - + + +
+
+ + + + + +
-
- - -
-
- - - - - + + +
+
+ + + + + +
-
- - + + +
); diff --git a/app/[locale]/(protected)/supervisor/frequently-asked-question/components/column.tsx b/app/[locale]/(protected)/supervisor/faq/components/column.tsx similarity index 100% rename from app/[locale]/(protected)/supervisor/frequently-asked-question/components/column.tsx rename to app/[locale]/(protected)/supervisor/faq/components/column.tsx diff --git a/app/[locale]/(protected)/supervisor/frequently-asked-question/components/table.tsx b/app/[locale]/(protected)/supervisor/faq/components/table.tsx similarity index 100% rename from app/[locale]/(protected)/supervisor/frequently-asked-question/components/table.tsx rename to app/[locale]/(protected)/supervisor/faq/components/table.tsx diff --git a/app/[locale]/(protected)/supervisor/frequently-asked-question/layout.tsx b/app/[locale]/(protected)/supervisor/faq/layout.tsx similarity index 100% rename from app/[locale]/(protected)/supervisor/frequently-asked-question/layout.tsx rename to app/[locale]/(protected)/supervisor/faq/layout.tsx diff --git a/app/[locale]/(protected)/supervisor/frequently-asked-question/page.tsx b/app/[locale]/(protected)/supervisor/faq/page.tsx similarity index 100% rename from app/[locale]/(protected)/supervisor/frequently-asked-question/page.tsx rename to app/[locale]/(protected)/supervisor/faq/page.tsx diff --git a/app/[locale]/(protected)/table/react-table/layout.tsx b/app/[locale]/(protected)/table/react-table/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/table/react-table/layout.tsx +++ b/app/[locale]/(protected)/table/react-table/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/utility/blank-page/layout.tsx b/app/[locale]/(protected)/utility/blank-page/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/utility/blank-page/layout.tsx +++ b/app/[locale]/(protected)/utility/blank-page/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/utility/blog/layout.tsx b/app/[locale]/(protected)/utility/blog/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/utility/blog/layout.tsx +++ b/app/[locale]/(protected)/utility/blog/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/utility/faq/layout.tsx b/app/[locale]/(protected)/utility/faq/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/utility/faq/layout.tsx +++ b/app/[locale]/(protected)/utility/faq/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/utility/invoice/add/layout.tsx b/app/[locale]/(protected)/utility/invoice/add/layout.tsx index bff0fb8a..4728748a 100644 --- a/app/[locale]/(protected)/utility/invoice/add/layout.tsx +++ b/app/[locale]/(protected)/utility/invoice/add/layout.tsx @@ -1,6 +1,6 @@ export const metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const layout = ({ children }: { children: React.ReactNode }) => { diff --git a/app/[locale]/(protected)/utility/invoice/edit/layout.tsx b/app/[locale]/(protected)/utility/invoice/edit/layout.tsx index bff0fb8a..4728748a 100644 --- a/app/[locale]/(protected)/utility/invoice/edit/layout.tsx +++ b/app/[locale]/(protected)/utility/invoice/edit/layout.tsx @@ -1,6 +1,6 @@ export const metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const layout = ({ children }: { children: React.ReactNode }) => { diff --git a/app/[locale]/(protected)/utility/invoice/layout.tsx b/app/[locale]/(protected)/utility/invoice/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/utility/invoice/layout.tsx +++ b/app/[locale]/(protected)/utility/invoice/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/utility/pricing/layout.tsx b/app/[locale]/(protected)/utility/pricing/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/utility/pricing/layout.tsx +++ b/app/[locale]/(protected)/utility/pricing/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/utility/profile/layout.tsx b/app/[locale]/(protected)/utility/profile/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/(protected)/utility/profile/layout.tsx +++ b/app/[locale]/(protected)/utility/profile/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(protected)/utility/settings/layout.tsx b/app/[locale]/(protected)/utility/settings/layout.tsx index 9804c128..a490cd7d 100644 --- a/app/[locale]/(protected)/utility/settings/layout.tsx +++ b/app/[locale]/(protected)/utility/settings/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Dashcode Next Js", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/(public)/audio/layout.tsx b/app/[locale]/(public)/audio/layout.tsx index 2cb8c934..fab820cf 100644 --- a/app/[locale]/(public)/audio/layout.tsx +++ b/app/[locale]/(public)/audio/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Footer from "@/components/landing-page/footer"; import Navbar from "@/components/landing-page/navbar"; diff --git a/app/[locale]/(public)/contact/layout.tsx b/app/[locale]/(public)/contact/layout.tsx index 5eca8060..b83fc734 100644 --- a/app/[locale]/(public)/contact/layout.tsx +++ b/app/[locale]/(public)/contact/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Navbar from "@/components/landing-page/navbar"; import Footer from "@/components/landing-page/footer"; diff --git a/app/[locale]/(public)/document/layout.tsx b/app/[locale]/(public)/document/layout.tsx index 2cb8c934..fab820cf 100644 --- a/app/[locale]/(public)/document/layout.tsx +++ b/app/[locale]/(public)/document/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Footer from "@/components/landing-page/footer"; import Navbar from "@/components/landing-page/navbar"; diff --git a/app/[locale]/(public)/faqs/layout.tsx b/app/[locale]/(public)/faqs/layout.tsx index 5eca8060..b83fc734 100644 --- a/app/[locale]/(public)/faqs/layout.tsx +++ b/app/[locale]/(public)/faqs/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Navbar from "@/components/landing-page/navbar"; import Footer from "@/components/landing-page/footer"; diff --git a/app/[locale]/(public)/feedback/layout.tsx b/app/[locale]/(public)/feedback/layout.tsx index 5eca8060..b83fc734 100644 --- a/app/[locale]/(public)/feedback/layout.tsx +++ b/app/[locale]/(public)/feedback/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Navbar from "@/components/landing-page/navbar"; import Footer from "@/components/landing-page/footer"; diff --git a/app/[locale]/(public)/image/detail/[slug]/page.tsx b/app/[locale]/(public)/image/detail/[slug]/page.tsx index 019a0af6..01b01766 100644 --- a/app/[locale]/(public)/image/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/image/detail/[slug]/page.tsx @@ -90,8 +90,8 @@ const DetailInfo = () => {
- {detailDataImage?.tags?.split(",").map((tag: string) => ( -

{tag}

+ {detailDataImage?.tags?.split(",").map((tag: string, index: number) => ( +

{tag}

))}
diff --git a/app/[locale]/(public)/image/layout.tsx b/app/[locale]/(public)/image/layout.tsx index 2cb8c934..fab820cf 100644 --- a/app/[locale]/(public)/image/layout.tsx +++ b/app/[locale]/(public)/image/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Footer from "@/components/landing-page/footer"; import Navbar from "@/components/landing-page/navbar"; diff --git a/app/[locale]/(public)/indeks/layout.tsx b/app/[locale]/(public)/indeks/layout.tsx index 2cb8c934..fab820cf 100644 --- a/app/[locale]/(public)/indeks/layout.tsx +++ b/app/[locale]/(public)/indeks/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Footer from "@/components/landing-page/footer"; import Navbar from "@/components/landing-page/navbar"; diff --git a/app/[locale]/(public)/schedule/layout.tsx b/app/[locale]/(public)/schedule/layout.tsx index 2cb8c934..fab820cf 100644 --- a/app/[locale]/(public)/schedule/layout.tsx +++ b/app/[locale]/(public)/schedule/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Footer from "@/components/landing-page/footer"; import Navbar from "@/components/landing-page/navbar"; diff --git a/app/[locale]/(public)/schedule/page.tsx b/app/[locale]/(public)/schedule/page.tsx index e22a56e9..f8634dc2 100644 --- a/app/[locale]/(public)/schedule/page.tsx +++ b/app/[locale]/(public)/schedule/page.tsx @@ -561,7 +561,7 @@ const Schedule = (props: any) => { Jadwal Hari ini {todayList?.map((list: any) => ( - +
{new Date(list.startDate).getDate()}

{list?.title}

@@ -586,7 +586,7 @@ const Schedule = (props: any) => { Jadwal Sebelumnya {prevdayList?.map((list: any) => ( - +
{new Date(list.startDate).getDate()}

{list?.title}

@@ -611,7 +611,7 @@ const Schedule = (props: any) => { Jadwal Selanjutnya {nextdayList?.map((list: any) => ( - +
{new Date(list.startDate).getDate()}

{list?.title}

diff --git a/app/[locale]/(public)/video/layout.tsx b/app/[locale]/(public)/video/layout.tsx index 2cb8c934..fab820cf 100644 --- a/app/[locale]/(public)/video/layout.tsx +++ b/app/[locale]/(public)/video/layout.tsx @@ -4,7 +4,7 @@ import DashCodeSidebar from "@/components/partials/sidebar"; import DashCodeFooter from "@/components/partials/footer"; import ThemeCustomize from "@/components/partials/customizer"; import DashCodeHeader from "@/components/partials/header"; -import { auth } from "@/lib/auth"; + import { redirect } from "@/components/navigation"; import Footer from "@/components/landing-page/footer"; import Navbar from "@/components/landing-page/navbar"; diff --git a/app/[locale]/auth/404/layout.tsx b/app/[locale]/auth/404/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/404/layout.tsx +++ b/app/[locale]/auth/404/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/coming-soon/layout.tsx b/app/[locale]/auth/coming-soon/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/coming-soon/layout.tsx +++ b/app/[locale]/auth/coming-soon/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/forgot-password/layout.tsx b/app/[locale]/auth/forgot-password/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/forgot-password/layout.tsx +++ b/app/[locale]/auth/forgot-password/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/forgot-password2/layout.tsx b/app/[locale]/auth/forgot-password2/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/forgot-password2/layout.tsx +++ b/app/[locale]/auth/forgot-password2/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/forgot-password3/layout.tsx b/app/[locale]/auth/forgot-password3/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/forgot-password3/layout.tsx +++ b/app/[locale]/auth/forgot-password3/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/lock-screen/layout.tsx b/app/[locale]/auth/lock-screen/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/lock-screen/layout.tsx +++ b/app/[locale]/auth/lock-screen/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/lock-screen2/layout.tsx b/app/[locale]/auth/lock-screen2/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/lock-screen2/layout.tsx +++ b/app/[locale]/auth/lock-screen2/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/lock-screen3/layout.tsx b/app/[locale]/auth/lock-screen3/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/lock-screen3/layout.tsx +++ b/app/[locale]/auth/lock-screen3/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/login/layout.tsx b/app/[locale]/auth/login/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/login/layout.tsx +++ b/app/[locale]/auth/login/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/login2/layout.tsx b/app/[locale]/auth/login2/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/login2/layout.tsx +++ b/app/[locale]/auth/login2/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/login3/layout.tsx b/app/[locale]/auth/login3/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/login3/layout.tsx +++ b/app/[locale]/auth/login3/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/register/layout.tsx b/app/[locale]/auth/register/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/register/layout.tsx +++ b/app/[locale]/auth/register/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/register2/layout.tsx b/app/[locale]/auth/register2/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/register2/layout.tsx +++ b/app/[locale]/auth/register2/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/register3/layout.tsx b/app/[locale]/auth/register3/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/register3/layout.tsx +++ b/app/[locale]/auth/register3/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/under-construction/layout.tsx b/app/[locale]/auth/under-construction/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/under-construction/layout.tsx +++ b/app/[locale]/auth/under-construction/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/auth/under-maintenance/layout.tsx b/app/[locale]/auth/under-maintenance/layout.tsx index 5666cfeb..6e956709 100644 --- a/app/[locale]/auth/under-maintenance/layout.tsx +++ b/app/[locale]/auth/under-maintenance/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next"; export const metadata: Metadata = { title: "Media Hub | POLRI", - description: "Dashcode is a popular dashboard template.", + description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", }; const Layout = ({ children }: { children: React.ReactNode }) => { return <>{children}; diff --git a/app/[locale]/globals.css b/app/[locale]/globals.css index af1fb9d9..c27510ef 100644 --- a/app/[locale]/globals.css +++ b/app/[locale]/globals.css @@ -34,8 +34,6 @@ --warning: 16 93% 70%; --warning-foreground: 33.3 100% 96.5%; - - --success: 154 52% 55%; --success-foreground: 138.5 76.5% 96.7%; @@ -85,7 +83,6 @@ } .dark { - --background: 222.2 47.4% 11.2%; --foreground: 210 40% 98%; @@ -94,7 +91,6 @@ --popover: 222.2 84% 4.9%; --popover-foreground: 210 40% 98%; - --card: 215 27.9% 16.9%; --card-foreground: 210 40% 98%; @@ -166,19 +162,16 @@ .dashcode-app-codeVmapWarning path { @apply fill-warning; } -.dashcode-app-codeVmapWarning path .svg-map__location[aria-checked="true"] { - @apply fill-warning; +.dashcode-app-codeVmapWarning path .svg-map__location[aria-checked="true"] { + @apply fill-warning; } .dashcode-app-codeVmapSuccess path { @apply fill-success; - } -.dashcode-app-codeVmapSuccess path .svg-map__location[aria-checked="true"] { - @apply fill-success; +.dashcode-app-codeVmapSuccess path .svg-map__location[aria-checked="true"] { + @apply fill-success; } - - @layer base { * { @apply border-border; @@ -208,7 +201,6 @@ padding-right: 0px !important; } - .no-scrollbar::-webkit-scrollbar { width: 0px; } @@ -216,7 +208,6 @@ .no-scrollbar::-webkit-scrollbar-thumb { background-color: transparent; } - } .logo-box-3 { @@ -227,15 +218,23 @@ @apply flex flex-col items-center justify-center; } - .has-sticky-header::after { position: absolute; z-index: -10; --tw-backdrop-blur: blur(12px); - backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) + var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) + var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) + var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) + var(--tw-backdrop-sepia); --tw-content: ""; content: var(--tw-content); - background: linear-gradient(180deg, rgba(var(--v-theme-background)) 44%, rgba(var(--v-theme-background)) 73%, rgba(var(--v-theme-background))); + background: linear-gradient( + 180deg, + rgba(var(--v-theme-background)) 44%, + rgba(var(--v-theme-background)) 73%, + rgba(var(--v-theme-background)) + ); background-repeat: repeat; block-size: 5.5rem; inset-block-start: -2.5rem; @@ -248,10 +247,19 @@ position: absolute; z-index: -10; --tw-backdrop-blur: blur(12px); - backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) + var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) + var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) + var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) + var(--tw-backdrop-sepia); --tw-content: ""; content: var(--tw-content); - background: linear-gradient(180deg, rgba(var(--v-theme-background)) 44%, rgba(var(--v-theme-background)) 73%, rgba(var(--v-theme-background))); + background: linear-gradient( + 180deg, + rgba(var(--v-theme-background)) 44%, + rgba(var(--v-theme-background)) 73%, + rgba(var(--v-theme-background)) + ); background-repeat: repeat; block-size: 5.5rem; inset-block-start: 1.5rem; @@ -365,7 +373,7 @@ @apply hidden; } -.dashcode-app-calendar .fc .fc-list-sticky .fc-list-day>* { +.dashcode-app-calendar .fc .fc-list-sticky .fc-list-day > * { @apply bg-default-50; } @@ -373,12 +381,11 @@ @apply pt-0; } -.dashcode-app-calendar .fc-timegrid-event-harness>.fc-timegrid-event { +.dashcode-app-calendar .fc-timegrid-event-harness > .fc-timegrid-event { @apply static; } @media (max-width: 981px) { - .dashcode-app-calendar .fc-button-group, .dashcode-app-calendar .fc .fc-toolbar { display: block !important; @@ -445,14 +452,13 @@ @apply bg-success border-none text-primary-foreground text-center px-2 font-medium text-sm; } -.dashcode-app-calendar .dark { +.dashcode-app-calendar .dark { @apply bg-card-foreground border-none text-primary-foreground px-2 font-medium text-sm; } - /* react select */ - .dashcode-app .react-select .react-select.is-invalid .select__control { +.dashcode-app .react-select .react-select.is-invalid .select__control { border-color: none !important; } @@ -473,10 +479,13 @@ } .dashcode-app .react-select .select__menu .select__option { - @apply hover:bg-default/10; + @apply hover:bg-default/10; } -.dashcode-app .react-select .select__menu .select__option.select__option--is-selected { +.dashcode-app + .react-select + .select__menu + .select__option.select__option--is-selected { @apply bg-default dark:bg-default-200; } @@ -492,11 +501,16 @@ @apply text-default-500; } -.dashcode-app .react-select .react-select__control.select__control--is-disabled { +.dashcode-app + .react-select + .react-select__control.select__control--is-disabled { @apply cursor-not-allowed; } -.dashcode-app .react-select .react-select__control .select__indicator-separator { +.dashcode-app + .react-select + .react-select__control + .select__indicator-separator { @apply bg-default-50 text-default-800 placeholder:text-opacity-60; } @@ -504,7 +518,12 @@ @apply cursor-pointer text-default-600; } -.dashcode-app .react-select .has-error .react-select__control .select__indicator svg { +.dashcode-app + .react-select + .has-error + .react-select__control + .select__indicator + svg { @apply text-destructive; } @@ -520,9 +539,9 @@ @apply fill-default-foreground; } -html[dir=rtl] .react-select .select__loading-indicator { +html[dir="rtl"] .react-select .select__loading-indicator { flex-direction: row-reverse; -} +} /* quil editor */ .ql-container { @@ -540,4 +559,18 @@ html[dir=rtl] .react-select .select__loading-indicator { width: 100%; } +.custom-scrollbar-table::-webkit-scrollbar { + width: 1px; +} +.custom-scrollbar-table::-webkit-scrollbar-track { + background: #e5e7eb; +} + +.custom-scrollbar-table::-webkit-scrollbar-thumb { + background: #6b7280; +} + +.custom-scrollbar-table::-webkit-scrollbar-thumb:hover { + background: #9ca3af; +} diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 47c0c6ec..ba10a66c 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -15,7 +15,7 @@ import DirectionProvider from "@/providers/direction-provider"; import AuthProvider from "@/providers/auth.provider"; export const metadata: Metadata = { - title: "Dashcode admin Template", + title: "Media Hub | POLRI", description: "created by codeshaper", }; diff --git a/app/favicon-vercel.ico b/app/favicon-vercel.ico new file mode 100644 index 00000000..718d6fea Binary files /dev/null and b/app/favicon-vercel.ico differ diff --git a/app/favicon.ico b/app/favicon.ico index 718d6fea..f2ee7f10 100644 Binary files a/app/favicon.ico and b/app/favicon.ico differ diff --git a/components/form/blog/blog--update-form.tsx b/components/form/blog/blog--update-form.tsx new file mode 100644 index 00000000..e44293e5 --- /dev/null +++ b/components/form/blog/blog--update-form.tsx @@ -0,0 +1,415 @@ +"use client"; +import React, { ChangeEvent, useEffect, useRef, useState } from "react"; +import { useForm, Controller } from "react-hook-form"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; +import { Card } from "@/components/ui/card"; +import { zodResolver } from "@hookform/resolvers/zod"; +import * as z from "zod"; +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; +import { useParams, useRouter } from "next/navigation"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { Checkbox } from "@/components/ui/checkbox"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import JoditEditor from "jodit-react"; +import { register } from "module"; +import { Switch } from "@/components/ui/switch"; +import Cookies from "js-cookie"; +import { createTask } from "@/config/api"; +import { + createMedia, + getTagsBySubCategoryId, + listEnableCategory, +} from "@/service/content/content"; +import { getBlog, postBlog } from "@/service/blog/blog"; +import { Badge } from "@/components/ui/badge"; + +const taskSchema = z.object({ + title: z.string().min(1, { message: "Judul diperlukan" }), + slug: z.string().min(1, { message: "Judul diperlukan" }), + metadata: z.string().min(1, { message: "Judul diperlukan" }), + narration: z + .string() + .min(2, { message: "Narasi Penugasan harus lebih dari 2 karakter." }), + categoryName: z.string().min(1, { message: "Kategori diperlukan" }), +}); + +type Category = { + id: string; + categoryName: string; +}; + +type Detail = { + id: number; + title: string; + narration: string; + slug: string; + metadata: string; + categoryName: string; + categoryId: string; + thumbnailLink: string; + tags: string; +}; + +const initialCategories: Category[] = [ + { + id: "1", + categoryName: "Giat Polri", + }, + { + id: "2", + categoryName: "Giat Pimpinan", + }, + { + id: "3", + categoryName: "Liputan Kegiatan", + }, + { + id: "4", + categoryName: "Seputar Prestasi", + }, +]; + +export default function FormBlogUpdate() { + const MySwal = withReactContent(Swal); + const router = useRouter(); + const { id } = useParams() as { id: string }; + console.log(id); + const editor = useRef(null); + type TaskSchema = z.infer; + + const [selectedFiles, setSelectedFiles] = useState([]); + const taskId = Cookies.get("taskId"); + const scheduleId = Cookies.get("scheduleId"); + const scheduleType = Cookies.get("scheduleType"); + + const [categories] = useState(initialCategories); + const [selectedTarget, setSelectedTarget] = useState(""); + const [selectedCategory, setSelectedCategory] = useState(); + const [tags, setTags] = useState([]); + const [isDraft, setIsDraft] = useState(false); + + const [detail, setDetail] = useState(); + const [refresh, setRefresh] = useState(false); + + const [unitSelection, setUnitSelection] = useState({ + allUnit: false, + mabes: false, + polda: false, + polres: false, + }); + + let fileTypeId = "1"; + + const { + control, + handleSubmit, + setValue, + formState: { errors }, + } = useForm({ + resolver: zodResolver(taskSchema), + }); + + const handleRemoveTag = (index: any) => { + setTags((prevTags) => prevTags.filter((_, i) => i !== index)); + }; + + const handleImageChange = (event: ChangeEvent) => { + if (event.target.files) { + const files = Array.from(event.target.files); + setSelectedFiles((prevImages: any) => [...prevImages, ...files]); + console.log("DATAFILE::", selectedFiles); + } + }; + + const handleRemoveImage = (index: number) => { + setSelectedFiles((prevImages) => prevImages.filter((_, i) => i !== index)); + }; + + useEffect(() => { + async function initState() { + if (id) { + const response = await getBlog(id); + const details = response.data?.data; + + setDetail(details); + + // Set categoryId dari API ke form dan Select + setValue("categoryName", details?.categoryName); + setSelectedTarget(details?.categoryId); // Untuk dropdown + } + } + initState(); + }, [refresh, setValue]); + + const save = async (data: TaskSchema) => { + const requestData = { + ...data, + id: detail?.id, + title: data.title, + narration: data.narration, + categoryId: selectedTarget, + slug: data.slug, + metadata: data.metadata, + tags: "siap", + isDraft, + }; + + const response = await postBlog(requestData); + console.log("Form Data Submitted:", requestData); + console.log("response", response); + + MySwal.fire({ + title: "Sukses", + text: "Data berhasil disimpan.", + icon: "success", + confirmButtonColor: "#3085d6", + confirmButtonText: "OK", + }).then(() => { + router.push("/en/contributor/blog"); + }); + }; + + const onSubmit = (data: TaskSchema) => { + MySwal.fire({ + title: "Simpan Data", + text: "Apakah Anda yakin ingin menyimpan data ini?", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Simpan", + }).then((result) => { + if (result.isConfirmed) { + save(data); + } + }); + }; + + const handlePublish = () => { + setIsDraft(false); + }; + + const handleSave = () => { + setIsDraft(false); + }; + + return ( +
+ {detail !== undefined ? ( +
+ +
+

Update Indeks

+
+ {/* Input Title */} +
+ + ( + + )} + /> + {errors.title?.message && ( +

+ {errors.title.message} +

+ )} +
+ +
+ + ( + + )} + /> + {errors.narration?.message && ( +

+ {errors.narration.message} +

+ )} +
+
+
+ + ( + + )} + /> + {errors.slug?.message && ( +

+ {errors.slug.message} +

+ )} +
+
+
+
+ + ( + + )} + /> + {errors.metadata?.message && ( +

+ {errors.metadata.message} +

+ )} +
+
+
+
+
+
+ +
+ + { + // const file = e.target.files[0]; + // if (file) { + // console.log("Selected File:", file); + // // Tambahkan logika jika diperlukan, misalnya upload file ke server + // } + // }} + className="" + /> +
+
+ + + Thumbnail Gambar Utama + +
+
+ + ( + + )} + /> +
+
+
+ +
+ {detail?.tags?.split(",").map((tag, index) => ( + + {tag.trim()} + + ))} +
+
+
+
+
+ {/*
+ +
*/} +
+ +
+
+ +
+
+
+
+ ) : ( + "" + )} +
+ ); +} diff --git a/components/form/communication/internal-detail-form.tsx b/components/form/communication/internal-detail-form.tsx index 9583c542..77462c93 100644 --- a/components/form/communication/internal-detail-form.tsx +++ b/components/form/communication/internal-detail-form.tsx @@ -200,8 +200,8 @@ export default function FormDetailInternal() {
{ticketReply?.map((list) => ( -
-

+

+

Ticket #{list.id}

@@ -224,7 +224,7 @@ export default function FormDetailInternal() {

{list?.createdAt}

-

{list.message}

+

{list.message}

))}
diff --git a/components/form/communication/internal-edit-form.tsx b/components/form/communication/internal-edit-form.tsx new file mode 100644 index 00000000..2bcf5dc2 --- /dev/null +++ b/components/form/communication/internal-edit-form.tsx @@ -0,0 +1,363 @@ +"use client"; +"use client"; +import React, { useEffect, useState } from "react"; +import { useForm, Controller } from "react-hook-form"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; +import { Card } from "@/components/ui/card"; +import { zodResolver } from "@hookform/resolvers/zod"; +import * as z from "zod"; +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; +import { useParams, useRouter } from "next/navigation"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { Avatar, AvatarImage } from "@/components/ui/avatar"; +import { + getTicketingInternalDetail, + getTicketingInternalDiscussion, + saveTicketing, + saveTicketInternalReply, +} from "@/service/communication/communication"; +import { Textarea } from "@/components/ui/textarea"; + +const taskSchema = z.object({ + // description: z.string().min(2, { + // message: "Narasi Penugasan harus lebih dari 2 karakter.", + // }), +}); + +export type taskDetail = { + id: number; + title: string; + createdAt: string; + createdBy: { + id: number; + fullname: string; + }; + sendTo: { + id: number; + fullname: string; + }; + status: { + id: number; + name: string; + }; + priority: { + id: number; + name: string; + }; + description: string; + is_active: string; +}; + +export type replyDetail = { + id: number; + message: string; + createdAt: string; + messageFrom: { + id: number; + fullname: string; + }; + messageTo: { + id: number; + fullname: string; + }; +}; + +export default function FormEditInternal() { + const MySwal = withReactContent(Swal); + const { id } = useParams() as { id: string }; + const router = useRouter(); + + const [detail, setDetail] = useState(); + const [ticketReply, setTicketReply] = useState([]); + const [replyVisible, setReplyVisible] = useState(false); + const [replyMessage, setReplyMessage] = useState(""); + const [selectedPriority, setSelectedPriority] = useState(""); + const [selectedStatus, setSelectedStatus] = useState(""); + const [selectedTarget, setSelectedTarget] = useState(""); + type TaskSchema = z.infer; + + const { + control, + handleSubmit, + formState: { errors }, + } = useForm({ + resolver: zodResolver(taskSchema), + }); + + useEffect(() => { + async function initState() { + if (id) { + const response = await getTicketingInternalDetail(id); + setDetail(response.data?.data); + } + } + initState(); + getTicketReply(); + }, [id]); + + async function getTicketReply() { + const res = await getTicketingInternalDiscussion(id); + if (res.data !== null) { + setTicketReply(res.data?.data); + } + } + + const handleReply = () => { + setReplyVisible((prev) => !prev); // Toggle visibility + }; + + const handleSendReply = async () => { + if (replyMessage.trim() === "") { + MySwal.fire({ + title: "Error", + text: "Pesan tidak boleh kosong!", + icon: "error", + }); + return; + } + + const data = { + ticketId: id, + message: replyMessage, + }; + + try { + const response = await saveTicketInternalReply(data); + + // Tambahkan balasan baru ke daftar balasan + const newReply: replyDetail = { + id: response.data.id, + message: replyMessage, + createdAt: response.data.createdAt, + messageFrom: response.data.messageFrom, + messageTo: response.data.messageTo, + }; + + setTicketReply((prevReplies) => [newReply, ...prevReplies]); + + MySwal.fire({ + title: "Sukses", + text: "Pesan berhasil dikirim.", + icon: "success", + }); + + // Reset input dan sembunyikan form balasan + setReplyMessage(""); + setReplyVisible(false); + } catch (error) { + MySwal.fire({ + title: "Error", + text: "Gagal mengirim balasan.", + icon: "error", + }); + console.error("Error sending reply:", error); + } + }; + + const save = async (data: TaskSchema) => { + const requestData = { + // description: data?.description, + target: selectedTarget, + priorityId: 1, + statusId: 1, + // description: data.description, + // operatorTeam: selectedOptionId.join(","), // This should work now without the error + }; + + const response = await saveTicketing(requestData); + + console.log("Form Data Submitted:", requestData); + console.log("response", response); + + MySwal.fire({ + title: "Sukses", + text: "Data berhasil disimpan.", + icon: "success", + confirmButtonColor: "#3085d6", + confirmButtonText: "OK", + }).then(() => { + router.push("/en/shared/communication"); + }); + }; + + const onSubmit = (data: TaskSchema) => { + MySwal.fire({ + title: "Simpan Data", + text: "Apakah Anda yakin ingin menyimpan data ini?", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Simpan", + }).then((result) => { + if (result.isConfirmed) { + save(data); + } + }); + }; + + return ( + +
+
+ + + +
+ + {replyVisible && ( +
+ +