Compare commits
1 Commits
dev-restru
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
35f33fc5e5 |
|
|
@ -0,0 +1,34 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: humas-fe-build
|
||||||
|
|
||||||
|
server:
|
||||||
|
host:
|
||||||
|
from_secret: ssh_host
|
||||||
|
user:
|
||||||
|
from_secret: ssh_user
|
||||||
|
ssh_key:
|
||||||
|
from_secret: ssh_key
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: prepare repo
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- prod
|
||||||
|
commands:
|
||||||
|
- rm -rf /opt/build/web-humas-fe
|
||||||
|
- mkdir -p /opt/build/web-humas-fe
|
||||||
|
- cd /opt/build
|
||||||
|
- git clone http://38.47.180.165:3000/humas/web-humas-fe.git
|
||||||
|
- cd /opt/build/web-humas-fe
|
||||||
|
- git checkout $DRONE_BRANCH
|
||||||
|
|
||||||
|
- name: build image
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- prod
|
||||||
|
commands:
|
||||||
|
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
|
||||||
|
- cd /opt/build/web-humas-fe
|
||||||
|
- docker build -t 38.47.180.165:3000/humas/web-humas-fe:$DRONE_BRANCH .
|
||||||
|
- docker push 38.47.180.165:3000/humas/web-humas-fe:$DRONE_BRANCH
|
||||||
|
|
@ -7,27 +7,23 @@ build-dev:
|
||||||
when: on_success
|
when: on_success
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
- dev-restructure
|
image: docker:stable
|
||||||
- dev-main
|
|
||||||
image: docker:25.0.3-cli
|
|
||||||
services:
|
services:
|
||||||
- name: docker:25.0.3-dind
|
- name: docker:dind
|
||||||
command: ["--insecure-registry=38.47.185.86:8900"]
|
command: ["--insecure-registry=103.82.242.92:8900"]
|
||||||
script:
|
script:
|
||||||
- docker logout
|
- docker logout
|
||||||
- docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN 38.47.185.86:8900
|
- docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN 103.82.242.92:8900
|
||||||
- docker build -t 38.47.185.86:8900/humas/web-humas-fe:dev .
|
- docker build -t 103.82.242.92:8900/humas/web-humas-fe:dev .
|
||||||
- docker push 38.47.185.86:8900/humas/web-humas-fe:dev
|
- docker push 103.82.242.92:8900/humas/web-humas-fe:dev
|
||||||
|
|
||||||
auto-deploy:
|
auto-deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
when: on_success
|
when: on_success
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
- dev-restructure
|
|
||||||
- dev-main
|
|
||||||
image: curlimages/curl:latest
|
image: curlimages/curl:latest
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
script:
|
script:
|
||||||
- curl --user admin:$JENKINS_PWD http://38.47.185.86:8080/job/autodeploy-humas/build?token=autodeployhumas
|
- curl --user cekmedsos:$JENKINS_PWD http://103.82.242.92:8080/job/autodeploy-humas/build?token=autodeployhumas
|
||||||
|
|
|
||||||
96
Dockerfile
96
Dockerfile
|
|
@ -1,98 +1,24 @@
|
||||||
# FROM node:23.5.0-alpine
|
FROM node:21-alpine
|
||||||
|
|
||||||
# ENV PORT 4000
|
|
||||||
|
|
||||||
# # pnpm install globally
|
|
||||||
# RUN npm install -g pnpm
|
|
||||||
|
|
||||||
# # Create app directory
|
|
||||||
# RUN mkdir -p /usr/src/app
|
|
||||||
# WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
# # Installing dependencies
|
|
||||||
# COPY package.json pnpm-lock.yaml ./
|
|
||||||
|
|
||||||
# # Copy ckeditor5 to workdir
|
|
||||||
# COPY vendor/ckeditor5 ./vendor/ckeditor5
|
|
||||||
|
|
||||||
# # Install dependencies
|
|
||||||
# RUN pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
# # RUN npm install --force
|
|
||||||
# # RUN npm install -g npm@latest
|
|
||||||
# # RUN npm install
|
|
||||||
|
|
||||||
# # Copying source files
|
|
||||||
# COPY . .
|
|
||||||
|
|
||||||
# # Building app
|
|
||||||
# RUN pnpm run build
|
|
||||||
|
|
||||||
# EXPOSE 4000
|
|
||||||
|
|
||||||
# # Running the app
|
|
||||||
# CMD ["pnpm", "run", "start"]
|
|
||||||
|
|
||||||
# FROM node:23.5.0-alpine
|
|
||||||
|
|
||||||
# ENV PORT 4000
|
|
||||||
|
|
||||||
# # Install Yarn globally
|
|
||||||
# # RUN npm install -g yarn
|
|
||||||
|
|
||||||
# # Create app directory
|
|
||||||
# RUN mkdir -p /usr/src/app
|
|
||||||
# WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
# # Copy package.json and yarn.lock
|
|
||||||
# COPY package.json yarn.lock ./
|
|
||||||
|
|
||||||
# # Copy ckeditor5 to workdir
|
|
||||||
# COPY vendor/ckeditor5 ./vendor/ckeditor5
|
|
||||||
|
|
||||||
# # Install dependencies
|
|
||||||
# RUN yarn install --frozen-lockfile
|
|
||||||
|
|
||||||
# # Copying source files
|
|
||||||
# COPY . .
|
|
||||||
|
|
||||||
# # Building app
|
|
||||||
# RUN yarn build
|
|
||||||
|
|
||||||
# EXPOSE 4000
|
|
||||||
|
|
||||||
# # Running the app
|
|
||||||
# CMD ["yarn", "start"]
|
|
||||||
|
|
||||||
# Gunakan image Node.js
|
|
||||||
FROM node:23.5.0-alpine
|
|
||||||
|
|
||||||
# Tentukan port yang akan digunakan
|
|
||||||
ENV PORT 4000
|
ENV PORT 4000
|
||||||
|
|
||||||
# Buat direktori aplikasi
|
# Create app directory
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Salin file package.json dan lock file
|
# Installing dependencies
|
||||||
COPY package.json package-lock.json ./
|
COPY package*.json /usr/src/app/
|
||||||
|
|
||||||
# Salin ckeditor5 ke dalam workdir
|
# RUN npm install --force
|
||||||
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
|
||||||
|
|
||||||
# Instal dependensi
|
|
||||||
RUN npm install -g npm@latest
|
RUN npm install -g npm@latest
|
||||||
RUN npm install next --legacy-peer-deps
|
RUN npm install
|
||||||
# Salin semua file proyek
|
|
||||||
# COPY . .
|
# Copying source files
|
||||||
COPY . /usr/src/app
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
# Building app
|
||||||
# Bangun aplikasi
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Ekspos port aplikasi
|
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|
||||||
# Jalankan aplikasi
|
# Running the app
|
||||||
CMD ["npm", "run", "start"]
|
CMD "npm" "run" "start"
|
||||||
|
|
|
||||||
|
|
@ -1,316 +0,0 @@
|
||||||
"use client";
|
|
||||||
import { AddIcon, CloudUploadIcon, TimesIcon } from "@/components/icons";
|
|
||||||
import AdvertiseTable from "@/components/table/advertise/advertise-table";
|
|
||||||
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Chip,
|
|
||||||
Input,
|
|
||||||
Modal,
|
|
||||||
ModalBody,
|
|
||||||
ModalContent,
|
|
||||||
ModalFooter,
|
|
||||||
ModalHeader,
|
|
||||||
Radio,
|
|
||||||
RadioGroup,
|
|
||||||
Switch,
|
|
||||||
Textarea,
|
|
||||||
useDisclosure,
|
|
||||||
} from "@heroui/react";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import * as z from "zod";
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
|
||||||
import { Controller, useForm } from "react-hook-form";
|
|
||||||
import { Fragment, useEffect, useState } from "react";
|
|
||||||
import Swal from "sweetalert2";
|
|
||||||
import withReactContent from "sweetalert2-react-content";
|
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
|
||||||
import { close, error, loading } from "@/config/swal";
|
|
||||||
import Image from "next/image";
|
|
||||||
import {
|
|
||||||
createAdvertise,
|
|
||||||
createMediaFileAdvertise,
|
|
||||||
} from "@/services/advertisement";
|
|
||||||
|
|
||||||
const createArticleSchema = z.object({
|
|
||||||
title: z.string().min(2, {
|
|
||||||
message: "Judul harus diisi",
|
|
||||||
}),
|
|
||||||
url: z.string().min(1, {
|
|
||||||
message: "Link harus diisi",
|
|
||||||
}),
|
|
||||||
description: z.string().min(2, {
|
|
||||||
message: "Deskripsi harus diisi",
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default function AdvertisePage() {
|
|
||||||
const { isOpen, onOpen, onOpenChange, onClose } = useDisclosure();
|
|
||||||
const MySwal = withReactContent(Swal);
|
|
||||||
|
|
||||||
const [refresh, setRefresh] = useState(false);
|
|
||||||
const [placement, setPlacement] = useState("banner");
|
|
||||||
|
|
||||||
const [files, setFiles] = useState<File[]>([]);
|
|
||||||
|
|
||||||
const formOptions = {
|
|
||||||
resolver: zodResolver(createArticleSchema),
|
|
||||||
defaultValues: { title: "", description: "", url: "" },
|
|
||||||
};
|
|
||||||
|
|
||||||
const { getRootProps, getInputProps } = useDropzone({
|
|
||||||
onDrop: (acceptedFiles) => {
|
|
||||||
setFiles(acceptedFiles.map((file) => Object.assign(file)));
|
|
||||||
},
|
|
||||||
maxFiles: 1,
|
|
||||||
accept:
|
|
||||||
placement === "banner"
|
|
||||||
? {
|
|
||||||
"image/*": [],
|
|
||||||
"video/*": [],
|
|
||||||
}
|
|
||||||
: { "image/*": [] },
|
|
||||||
});
|
|
||||||
type UserSettingSchema = z.infer<typeof createArticleSchema>;
|
|
||||||
const {
|
|
||||||
control,
|
|
||||||
handleSubmit,
|
|
||||||
formState: { errors },
|
|
||||||
} = useForm<UserSettingSchema>(formOptions);
|
|
||||||
|
|
||||||
const onSubmit = async (values: z.infer<typeof createArticleSchema>) => {
|
|
||||||
loading();
|
|
||||||
const formData = {
|
|
||||||
title: values.title,
|
|
||||||
description: values.description,
|
|
||||||
placement: placement,
|
|
||||||
redirectLink: values.url,
|
|
||||||
};
|
|
||||||
const res = await createAdvertise(formData);
|
|
||||||
if (res?.error) {
|
|
||||||
error(res?.message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const idNow = res?.data?.data?.id;
|
|
||||||
|
|
||||||
if (files.length > 0) {
|
|
||||||
const formFiles = new FormData();
|
|
||||||
formFiles.append("file", files[0]);
|
|
||||||
const resFile = await createMediaFileAdvertise(idNow, formFiles);
|
|
||||||
}
|
|
||||||
|
|
||||||
close();
|
|
||||||
MySwal.fire({
|
|
||||||
title: "Sukses",
|
|
||||||
icon: "success",
|
|
||||||
confirmButtonColor: "#3085d6",
|
|
||||||
confirmButtonText: "OK",
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
setRefresh(!refresh);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRemoveFile = (file: File) => {
|
|
||||||
const uploadedFiles = files;
|
|
||||||
const filtered = uploadedFiles.filter((i) => i.name !== file.name);
|
|
||||||
setFiles([...filtered]);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
|
|
||||||
<Button
|
|
||||||
size="md"
|
|
||||||
className="bg-[#F07C00] text-white w-full lg:w-fit"
|
|
||||||
onPress={onOpen}
|
|
||||||
>
|
|
||||||
Buat Baru
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
|
||||||
<AdvertiseTable triggerRefresh={refresh} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Modal isOpen={isOpen} onOpenChange={onOpenChange} size="3xl">
|
|
||||||
<ModalContent>
|
|
||||||
{() => (
|
|
||||||
<>
|
|
||||||
<ModalHeader className="flex flex-col gap-1">
|
|
||||||
Advertise
|
|
||||||
</ModalHeader>
|
|
||||||
<ModalBody>
|
|
||||||
<form
|
|
||||||
onSubmit={handleSubmit(onSubmit)}
|
|
||||||
className="flex flex-col gap-3"
|
|
||||||
>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm">Judul</p>
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name="title"
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
id="title"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={value}
|
|
||||||
onChange={onChange}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
{errors?.title && (
|
|
||||||
<p className="text-red-400 text-sm">
|
|
||||||
{errors.title?.message}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm">Deskripsi</p>
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name="description"
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Textarea
|
|
||||||
type="text"
|
|
||||||
id="description"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={value}
|
|
||||||
onChange={onChange}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
{errors?.description && (
|
|
||||||
<p className="text-red-400 text-sm">
|
|
||||||
{errors.description?.message}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm">Link</p>
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name="url"
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
id="url"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={value}
|
|
||||||
onChange={onChange}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
{errors?.url && (
|
|
||||||
<p className="text-red-400 text-sm">
|
|
||||||
{errors.url?.message}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className="text-sm mt-3">Penempatan</p>
|
|
||||||
<RadioGroup
|
|
||||||
label=""
|
|
||||||
orientation="horizontal"
|
|
||||||
size="sm"
|
|
||||||
value={placement}
|
|
||||||
onValueChange={setPlacement}
|
|
||||||
>
|
|
||||||
<Radio value="banner">Banner</Radio>
|
|
||||||
<Radio value="jumbotron">Jumbotron</Radio>
|
|
||||||
</RadioGroup>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm mt-3">Thumbnail</p>
|
|
||||||
{files.length < 1 && (
|
|
||||||
<Fragment>
|
|
||||||
<div {...getRootProps({ className: "dropzone" })}>
|
|
||||||
<input {...getInputProps()} />
|
|
||||||
<div className=" w-full text-center border-dashed border border-default-200 dark:border-default-300 rounded-md py-[52px] flex items-center flex-col">
|
|
||||||
<CloudUploadIcon />
|
|
||||||
<h4 className=" text-2xl font-medium mb-1 mt-3 text-card-foreground/80">
|
|
||||||
Tarik file disini atau klik untuk upload.
|
|
||||||
</h4>
|
|
||||||
<div className=" text-xs text-muted-foreground">
|
|
||||||
( Upload file dengan format .jpg, .jpeg, atau
|
|
||||||
.png. Ukuran maksimal 100mb.)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{files.length > 0 && (
|
|
||||||
<div className="flex flex-row gap-2">
|
|
||||||
<Image
|
|
||||||
src={URL.createObjectURL(files[0])}
|
|
||||||
className="w-[30%]"
|
|
||||||
alt="thumbnail"
|
|
||||||
width={480}
|
|
||||||
height={480}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
className=" border-none rounded-full"
|
|
||||||
variant="bordered"
|
|
||||||
onPress={() => handleRemoveFile(files[0])}
|
|
||||||
>
|
|
||||||
<TimesIcon />
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<ModalFooter className="self-end grow items-end">
|
|
||||||
<Button
|
|
||||||
color="primary"
|
|
||||||
type="submit"
|
|
||||||
// isDisabled={files.length < 1}
|
|
||||||
>
|
|
||||||
Simpan
|
|
||||||
</Button>
|
|
||||||
<Button color="danger" variant="light" onPress={onClose}>
|
|
||||||
Tutup
|
|
||||||
</Button>
|
|
||||||
</ModalFooter>
|
|
||||||
</form>
|
|
||||||
</ModalBody>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</ModalContent>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
import CreateArticleForm from "@/components/form/article/create-article-form";
|
import FormArticle from '@/components/form/form-article'
|
||||||
import FormArticle from "@/components/form/form-article";
|
import { Card } from '@nextui-org/react'
|
||||||
import { Card } from "@heroui/react";
|
|
||||||
|
|
||||||
export default function CreateArticle() {
|
export default function CreateArticle() {
|
||||||
return (
|
return (
|
||||||
<div className="bg-transparent p-3 lg:p-8 !bg-slate-100 dark:!bg-black overflow-y-auto">
|
<Card className="h-[96vh] rounded-md my- ml-3 border bg-transparent">
|
||||||
{/* <FormArticle /> */}
|
<FormArticle />
|
||||||
<CreateArticleForm />
|
</Card>
|
||||||
</div>
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import EditArticleForm from "@/components/form/article/edit-article-form";
|
import FormDetailArticle from '@/components/form/form-detail-article'
|
||||||
|
import { Card } from '@nextui-org/react'
|
||||||
|
|
||||||
export default function DetailArticlePage() {
|
export default function DetailArticlePage() {
|
||||||
return (
|
return (
|
||||||
<div className="h-[96vh] bg-transparent p-3 lg:p-8 !bg-slate-100 dark:!bg-black overflow-y-auto">
|
<Card className="h-[96vh] rounded-md my- ml-3 border bg-transparent">
|
||||||
{/* <FormDetailArticle /> */}
|
<FormDetailArticle />
|
||||||
<EditArticleForm isDetail={true} />
|
</Card>
|
||||||
</div>
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import EditArticleForm from "@/components/form/article/edit-article-form";
|
import FormUpdateArticle from '@/components/form/form-edit-article'
|
||||||
|
import { Card } from '@nextui-org/react'
|
||||||
|
|
||||||
export default function UpdateArticlePage() {
|
export default function UpdateArticlePage() {
|
||||||
return (
|
return (
|
||||||
<div className="h-[96vh] bg-transparent p-3 lg:p-8 !bg-slate-100 dark:!bg-black overflow-y-auto">
|
<Card className="h-[96vh] rounded-md my- ml-3 border bg-transparent">
|
||||||
<EditArticleForm isDetail={false} />
|
<FormUpdateArticle />
|
||||||
</div>
|
</Card>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
"use client";
|
|
||||||
import EditGeneratedArticleChecker from "@/components/form/article/edit-generated-article-checker-form";
|
|
||||||
import EditGeneratedArticleContent from "@/components/form/article/edit-generated-article-content-form";
|
|
||||||
import { Card } from "@heroui/react";
|
|
||||||
import { Tab, Tabs } from "@heroui/react";
|
|
||||||
|
|
||||||
import { useParams } from "next/navigation";
|
|
||||||
|
|
||||||
export default function EditGeneratedArticlePage() {
|
|
||||||
const params = useParams();
|
|
||||||
const id = String(params.id);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Card className="rounded-md border bg-transparent p-6 overflow-auto">
|
|
||||||
<div className="flex flex-col gap-2">
|
|
||||||
<Tabs aria-label="Options">
|
|
||||||
<Tab key="content" title="Content">
|
|
||||||
<EditGeneratedArticleContent id={id} />
|
|
||||||
</Tab>
|
|
||||||
<Tab key="checker" title="Checker">
|
|
||||||
<EditGeneratedArticleChecker id={id} />
|
|
||||||
</Tab>
|
|
||||||
</Tabs>
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
import GenerateArticleForm from "@/components/form/article/generate-article-form";
|
|
||||||
import { Card } from "@heroui/react";
|
|
||||||
|
|
||||||
export default function GenerateArticle() {
|
|
||||||
return (
|
|
||||||
<Card className="rounded-md border bg-transparent">
|
|
||||||
<GenerateArticleForm />
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +1,23 @@
|
||||||
"use client";
|
"use client"
|
||||||
import { AddIcon } from "@/components/icons";
|
import { AddIcon } from "@/components/icons";
|
||||||
import ArticleTable from "@/components/table/article-table";
|
import ArticleTable from "@/components/table/article-table";
|
||||||
import generatedArticleIds from "@/store/generated-article-store";
|
import { Button, Card } from "@nextui-org/react";
|
||||||
import { Button, Card } from "@heroui/react";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
|
|
||||||
export default function BasicPage() {
|
export default function BasicPage() {
|
||||||
return (
|
return (
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
<div className="h-[96vh] overflow-x-hidden overflow-y-scroll gap-0 grid rounded-lg border-2 ml-4">
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
<div className="px-4">
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
|
<Card className="rounded-md my-5 pl-5 py-2">
|
||||||
<Link href="/admin/article/create">
|
<Link href="/admin/article/create">
|
||||||
<Button
|
<Button size="md" color="primary" className="w-min">
|
||||||
size="md"
|
<AddIcon />New Article
|
||||||
className="bg-[#F07C00] text-white w-full lg:w-fit"
|
|
||||||
>
|
|
||||||
Tambah Artikel
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
</Card>
|
||||||
|
<Card className="rounded-md my-5">
|
||||||
<ArticleTable />
|
<ArticleTable />
|
||||||
</div>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import CommentTable from "@/components/table/comment/comment-table";
|
|
||||||
|
|
||||||
export default function AdvertisePage() {
|
|
||||||
return (
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
|
|
||||||
<CommentTable />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,247 +0,0 @@
|
||||||
"use client";
|
|
||||||
import { close, error, loading } from "@/config/swal";
|
|
||||||
import { FormEvent, Fragment, useEffect, useRef, useState } from "react";
|
|
||||||
import { Controller, useForm } from "react-hook-form";
|
|
||||||
import * as z from "zod";
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
|
||||||
import Swal from "sweetalert2";
|
|
||||||
import withReactContent from "sweetalert2-react-content";
|
|
||||||
import { Input, Textarea } from "@heroui/input";
|
|
||||||
import { Button } from "@heroui/button";
|
|
||||||
import { useParams, useRouter } from "next/navigation";
|
|
||||||
import { getCommentById, saveCommentStatus } from "@/services/comment";
|
|
||||||
import {
|
|
||||||
Modal,
|
|
||||||
ModalBody,
|
|
||||||
ModalContent,
|
|
||||||
ModalFooter,
|
|
||||||
ModalHeader,
|
|
||||||
useDisclosure,
|
|
||||||
} from "@heroui/react";
|
|
||||||
import { getArticleById } from "@/services/article";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { postArticleComment } from "@/services/master-user";
|
|
||||||
import Cookies from "js-cookie";
|
|
||||||
|
|
||||||
interface DetailComments {
|
|
||||||
id: number;
|
|
||||||
message: string;
|
|
||||||
articleId: number;
|
|
||||||
commentFromName: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function ReviewComment() {
|
|
||||||
const MySwal = withReactContent(Swal);
|
|
||||||
const { isOpen, onOpen, onOpenChange } = useDisclosure();
|
|
||||||
|
|
||||||
const params = useParams();
|
|
||||||
const id = Number(params?.id);
|
|
||||||
const router = useRouter();
|
|
||||||
const [replyValue, setReplyValue] = useState("");
|
|
||||||
|
|
||||||
const [detailData, setDetailData] = useState<DetailComments>();
|
|
||||||
const [detailArticle, setDetailArticle] = useState<{
|
|
||||||
id: number;
|
|
||||||
slug: string;
|
|
||||||
title: string;
|
|
||||||
}>();
|
|
||||||
useEffect(() => {
|
|
||||||
initFetch();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const initFetch = async () => {
|
|
||||||
loading();
|
|
||||||
const res = await getCommentById(id);
|
|
||||||
setDetailData(res?.data?.data);
|
|
||||||
const resArticle = await getArticleById(res?.data?.data?.articleId);
|
|
||||||
setDetailArticle(resArticle?.data?.data);
|
|
||||||
close();
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleCommentStatus = async (statusId: number) => {
|
|
||||||
MySwal.fire({
|
|
||||||
title: "Submit Data",
|
|
||||||
text: "",
|
|
||||||
icon: "warning",
|
|
||||||
showCancelButton: true,
|
|
||||||
cancelButtonColor: "#d33",
|
|
||||||
confirmButtonColor: "#3085d6",
|
|
||||||
confirmButtonText: "Simpan",
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
saveStatus(statusId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const saveStatus = async (statusId: number) => {
|
|
||||||
const req = { id: id, statusId: statusId };
|
|
||||||
const res = await saveCommentStatus(req);
|
|
||||||
if (res?.error) {
|
|
||||||
error(res.message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
successSubmit("/admin/comment");
|
|
||||||
};
|
|
||||||
|
|
||||||
function successSubmit(redirect: string) {
|
|
||||||
MySwal.fire({
|
|
||||||
title: "Sukses",
|
|
||||||
icon: "success",
|
|
||||||
confirmButtonColor: "#3085d6",
|
|
||||||
confirmButtonText: "OK",
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
router.push(redirect);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const sendComment = async () => {
|
|
||||||
const data = {
|
|
||||||
commentFromEmail: "ppid@polri.go.id",
|
|
||||||
commentFromName: "Mabes Polri",
|
|
||||||
articleId: detailData?.articleId,
|
|
||||||
isPublic: true,
|
|
||||||
message: replyValue,
|
|
||||||
parentId: id,
|
|
||||||
};
|
|
||||||
|
|
||||||
const res = await postArticleComment(data);
|
|
||||||
if (res?.error) {
|
|
||||||
error(res?.message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
saveStatus(2);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="p-8">
|
|
||||||
<div className="bg-white text-black shadow-lg p-4 rounded-lg flex flex-col gap-3 text-sm w-full lg:w-1/2">
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p>Artikel</p>
|
|
||||||
<Link
|
|
||||||
target="_black"
|
|
||||||
className="text-primary hover:underline w-fit"
|
|
||||||
href={`/news/detail/${detailArticle?.id}-${detailArticle?.slug}`}
|
|
||||||
>
|
|
||||||
{detailArticle?.title}
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p>Nama</p>
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
id="username"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
isReadOnly
|
|
||||||
value={detailData?.commentFromName}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p>Komentar</p>
|
|
||||||
<Textarea
|
|
||||||
type="text"
|
|
||||||
id="address"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={detailData?.message}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p>Status</p>
|
|
||||||
<div className="flex flex-row gap-3">
|
|
||||||
<Button
|
|
||||||
onPress={() => handleCommentStatus(1)}
|
|
||||||
color="success"
|
|
||||||
className="w-fit text-white"
|
|
||||||
>
|
|
||||||
Setujui
|
|
||||||
</Button>
|
|
||||||
<Button onPress={onOpen} color="primary" className="w-fit">
|
|
||||||
Balas
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
onPress={() => handleCommentStatus(3)}
|
|
||||||
color="danger"
|
|
||||||
className="w-fit"
|
|
||||||
>
|
|
||||||
Tolak
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-full justify-end flex">
|
|
||||||
<Button
|
|
||||||
onPress={router.back}
|
|
||||||
color="danger"
|
|
||||||
variant="bordered"
|
|
||||||
className="w-fit"
|
|
||||||
>
|
|
||||||
Kembali
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Modal isOpen={isOpen} onOpenChange={onOpenChange}>
|
|
||||||
<ModalContent>
|
|
||||||
{(onClose) => (
|
|
||||||
<>
|
|
||||||
<ModalHeader className="flex flex-col gap-1">
|
|
||||||
Komentar Balasan
|
|
||||||
</ModalHeader>
|
|
||||||
<ModalBody>
|
|
||||||
<Textarea
|
|
||||||
type="text"
|
|
||||||
id="address"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={replyValue}
|
|
||||||
onValueChange={setReplyValue}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
</ModalBody>
|
|
||||||
<ModalFooter>
|
|
||||||
<Button color="danger" variant="light" onPress={onClose}>
|
|
||||||
Close
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
isDisabled={replyValue.length < 2}
|
|
||||||
color="primary"
|
|
||||||
onPress={() => sendComment()}
|
|
||||||
>
|
|
||||||
Submit
|
|
||||||
</Button>
|
|
||||||
</ModalFooter>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</ModalContent>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -2,10 +2,10 @@ import DashboardContainer from "@/components/main/dashboard/dashboard-container"
|
||||||
|
|
||||||
export default function AdminPage() {
|
export default function AdminPage() {
|
||||||
return (
|
return (
|
||||||
<div className="h-[96vh] overflow-x-hidden overflow-y-scroll gap-0 grid">
|
<div className="flex h-[96vh] overflow-x-hidden overflow-y-scroll gap-0 grid rounded-lg border-small ml-4">
|
||||||
<div className="lg:px-4 !w-screen lg:!w-auto">
|
<div className="px-4">
|
||||||
<DashboardContainer />
|
<DashboardContainer />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import CreateMagazineForm from '@/components/form/magazine/magazine-form'
|
||||||
|
import MagazineTable from '@/components/table/magazine/magazine-table'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
const AdminMagazineCreate = () => {
|
||||||
|
return (
|
||||||
|
<div><CreateMagazineForm /></div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AdminMagazineCreate
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
import MagazineTable from '@/components/table/magazine/magazine-table'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
const AdminMagazine = () => {
|
||||||
|
return (
|
||||||
|
<div><MagazineTable /></div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AdminMagazine
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import SuggestionsTable from "@/components/table/suggestions/suggestions-table";
|
|
||||||
|
|
||||||
export default function SuggestionsPage() {
|
|
||||||
return (
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
|
|
||||||
<SuggestionsTable />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import NewCreateMagazineForm from "@/components/form/magazine/create-magazine-form";
|
|
||||||
import CreateMagazineForm from "@/components/form/magazine/magazine-form";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const AdminMagazineCreate = () => {
|
|
||||||
return (
|
|
||||||
<div className="h-[96vh] bg-transparent p-3 lg:p-8 !bg-slate-100 dark:!bg-black overflow-y-auto">
|
|
||||||
<NewCreateMagazineForm />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AdminMagazineCreate;
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import EditMagazineForm from "@/components/form/magazine/edit-magazine-form";
|
|
||||||
|
|
||||||
export default function DetailArticlePage() {
|
|
||||||
return (
|
|
||||||
<div className="h-[96vh] bg-transparent p-3 lg:p-8 !bg-slate-100 dark:!bg-black overflow-y-auto">
|
|
||||||
<EditMagazineForm isDetail={true} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import EditMagazineForm from "@/components/form/magazine/edit-magazine-form";
|
|
||||||
|
|
||||||
export default function EditArticlePage() {
|
|
||||||
return (
|
|
||||||
<div className="h-[96vh] bg-transparent p-3 lg:p-8 !bg-slate-100 dark:!bg-black overflow-y-auto">
|
|
||||||
<EditMagazineForm isDetail={false} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
"use client";
|
|
||||||
import { AddIcon } from "@/components/icons";
|
|
||||||
import MagazineTable from "@/components/table/magazine/magazine-table";
|
|
||||||
import { Button } from "@heroui/react";
|
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
export default function MagazineTablePage() {
|
|
||||||
return (
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
|
|
||||||
<Link href="/admin/magazine/create">
|
|
||||||
<Button
|
|
||||||
size="md"
|
|
||||||
className="bg-[#F07C00] text-white w-full lg:w-fit"
|
|
||||||
>
|
|
||||||
Tambah Majalah
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
<MagazineTable />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,410 +0,0 @@
|
||||||
"use client";
|
|
||||||
import { AddIcon, CloudUploadIcon, TimesIcon } from "@/components/icons";
|
|
||||||
import ArticleTable from "@/components/table/article-table";
|
|
||||||
import CategoriesTable from "@/components/table/master-categories/categories-table";
|
|
||||||
import generatedArticleIds from "@/store/generated-article-store";
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Chip,
|
|
||||||
Input,
|
|
||||||
Modal,
|
|
||||||
ModalBody,
|
|
||||||
ModalContent,
|
|
||||||
ModalFooter,
|
|
||||||
ModalHeader,
|
|
||||||
Textarea,
|
|
||||||
useDisclosure,
|
|
||||||
} from "@heroui/react";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import * as z from "zod";
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
|
||||||
import { Controller, useForm } from "react-hook-form";
|
|
||||||
import { Fragment, useEffect, useState } from "react";
|
|
||||||
import { getArticleByCategory } from "@/services/article";
|
|
||||||
import ReactSelect from "react-select";
|
|
||||||
import makeAnimated from "react-select/animated";
|
|
||||||
import { useDropzone } from "react-dropzone";
|
|
||||||
import { close, error, loading } from "@/config/swal";
|
|
||||||
import {
|
|
||||||
createCategory,
|
|
||||||
uploadCategoryThumbnail,
|
|
||||||
} from "@/services/master-categories";
|
|
||||||
import Swal from "sweetalert2";
|
|
||||||
import withReactContent from "sweetalert2-react-content";
|
|
||||||
import Image from "next/image";
|
|
||||||
|
|
||||||
const categorySchema = z.object({
|
|
||||||
id: z.number(),
|
|
||||||
label: z.string(),
|
|
||||||
value: z.number(),
|
|
||||||
});
|
|
||||||
|
|
||||||
const createArticleSchema = z.object({
|
|
||||||
title: z.string().min(2, {
|
|
||||||
message: "Judul harus diisi",
|
|
||||||
}),
|
|
||||||
description: z.string().min(2, {
|
|
||||||
message: "Deskripsi harus diisi",
|
|
||||||
}),
|
|
||||||
tags: z.array(z.string()),
|
|
||||||
// parent: z.array(categorySchema).nonempty({
|
|
||||||
// message: "Kategori harus memiliki setidaknya satu item",
|
|
||||||
// }),
|
|
||||||
// tags: z.array(z.string()).nonempty({
|
|
||||||
// message: "Minimal 1 tag",
|
|
||||||
// }),
|
|
||||||
});
|
|
||||||
|
|
||||||
interface CategoryType {
|
|
||||||
id: number;
|
|
||||||
label: string;
|
|
||||||
value: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function MasterCategoryTable() {
|
|
||||||
const router = useRouter();
|
|
||||||
const MySwal = withReactContent(Swal);
|
|
||||||
|
|
||||||
const animatedComponents = makeAnimated();
|
|
||||||
const { isOpen, onOpen, onOpenChange, onClose } = useDisclosure();
|
|
||||||
const [listCategory, setListCategory] = useState<CategoryType[]>([]);
|
|
||||||
const [files, setFiles] = useState<File[]>([]);
|
|
||||||
const [refresh, setRefresh] = useState(false);
|
|
||||||
const [tag, setTag] = useState("");
|
|
||||||
const [selectedParent, setSelectedParent] = useState<any>();
|
|
||||||
|
|
||||||
const formOptions = {
|
|
||||||
resolver: zodResolver(createArticleSchema),
|
|
||||||
defaultValues: { title: "", description: "", tags: [] },
|
|
||||||
};
|
|
||||||
|
|
||||||
const { getRootProps, getInputProps } = useDropzone({
|
|
||||||
onDrop: (acceptedFiles) => {
|
|
||||||
setFiles(acceptedFiles.map((file) => Object.assign(file)));
|
|
||||||
},
|
|
||||||
maxFiles: 1,
|
|
||||||
});
|
|
||||||
type UserSettingSchema = z.infer<typeof createArticleSchema>;
|
|
||||||
const {
|
|
||||||
control,
|
|
||||||
handleSubmit,
|
|
||||||
formState: { errors },
|
|
||||||
setValue,
|
|
||||||
getValues,
|
|
||||||
watch,
|
|
||||||
setError,
|
|
||||||
clearErrors,
|
|
||||||
} = useForm<UserSettingSchema>(formOptions);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchCategory();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const fetchCategory = async () => {
|
|
||||||
const res = await getArticleByCategory();
|
|
||||||
if (res?.data?.data) {
|
|
||||||
setupCategory(res?.data?.data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const setupCategory = (data: any) => {
|
|
||||||
const temp = [];
|
|
||||||
for (const element of data) {
|
|
||||||
temp.push({
|
|
||||||
id: element.id,
|
|
||||||
label: element.title,
|
|
||||||
value: element.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
setListCategory(temp);
|
|
||||||
};
|
|
||||||
|
|
||||||
const onSubmit = async (values: z.infer<typeof createArticleSchema>) => {
|
|
||||||
console.log("values,", values);
|
|
||||||
loading();
|
|
||||||
const formData = {
|
|
||||||
title: values.title,
|
|
||||||
statusId: 1,
|
|
||||||
parentId: selectedParent ? selectedParent.id : 0,
|
|
||||||
tags: values.tags.join(","),
|
|
||||||
description: values.description,
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await createCategory(formData);
|
|
||||||
console.log(response);
|
|
||||||
if (response?.error) {
|
|
||||||
console.log();
|
|
||||||
if (
|
|
||||||
response.message?.messages[0]?.includes(
|
|
||||||
"article_categories_title_unique"
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
error("Judul sudah tersedia, silahkan buat dengan judul berbeda");
|
|
||||||
} else {
|
|
||||||
error(response.message?.messages);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const categoryId = response?.data?.data?.id;
|
|
||||||
const formFiles = new FormData();
|
|
||||||
|
|
||||||
formFiles.append("files", files[0]);
|
|
||||||
const resFile = await uploadCategoryThumbnail(categoryId, formFiles);
|
|
||||||
if (resFile?.error) {
|
|
||||||
error(resFile.message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
close();
|
|
||||||
setRefresh(!refresh);
|
|
||||||
MySwal.fire({
|
|
||||||
title: "Sukses",
|
|
||||||
icon: "success",
|
|
||||||
confirmButtonColor: "#3085d6",
|
|
||||||
confirmButtonText: "OK",
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRemoveFile = (file: File) => {
|
|
||||||
const uploadedFiles = files;
|
|
||||||
const filtered = uploadedFiles.filter((i) => i.name !== file.name);
|
|
||||||
setFiles([...filtered]);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
|
|
||||||
<Button
|
|
||||||
size="md"
|
|
||||||
className="bg-[#F07C00] text-white w-full lg:w-fit"
|
|
||||||
onPress={onOpen}
|
|
||||||
>
|
|
||||||
Tambah Kategori
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
|
||||||
<CategoriesTable triggerRefresh={refresh} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Modal isOpen={isOpen} onOpenChange={onOpenChange} size="3xl">
|
|
||||||
<ModalContent>
|
|
||||||
{() => (
|
|
||||||
<>
|
|
||||||
<ModalHeader className="flex flex-col gap-1">
|
|
||||||
Kategori Baru
|
|
||||||
</ModalHeader>
|
|
||||||
<ModalBody>
|
|
||||||
<form
|
|
||||||
onSubmit={handleSubmit(onSubmit)}
|
|
||||||
className="flex flex-col gap-3"
|
|
||||||
>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm">Nama Kategori</p>
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name="title"
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
id="title"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={value}
|
|
||||||
onChange={onChange}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
{errors?.title && (
|
|
||||||
<p className="text-red-400 text-sm">
|
|
||||||
{errors.title?.message}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm">Deskripsi</p>
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name="description"
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Textarea
|
|
||||||
type="text"
|
|
||||||
id="description"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={value}
|
|
||||||
onChange={onChange}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full "
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
{errors?.title && (
|
|
||||||
<p className="text-red-400 text-sm">
|
|
||||||
{errors.title?.message}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm mt-3">
|
|
||||||
Parent Kategori <span>(Optional)</span>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<ReactSelect
|
|
||||||
className="basic-single text-black z-50"
|
|
||||||
classNames={{
|
|
||||||
control: (state: any) =>
|
|
||||||
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
|
||||||
}}
|
|
||||||
classNamePrefix="select"
|
|
||||||
onChange={setSelectedParent}
|
|
||||||
closeMenuOnSelect={false}
|
|
||||||
components={animatedComponents}
|
|
||||||
isClearable={true}
|
|
||||||
isSearchable={true}
|
|
||||||
isMulti={false}
|
|
||||||
placeholder="Kategori..."
|
|
||||||
name="sub-module"
|
|
||||||
options={listCategory}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm mt-3">Tag Terkait</p>
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name="tags"
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
id="tags"
|
|
||||||
placeholder=""
|
|
||||||
label=""
|
|
||||||
value={tag}
|
|
||||||
onValueChange={setTag}
|
|
||||||
startContent={
|
|
||||||
<div className="flex flex-row gap-1">
|
|
||||||
{value.map((item, index) => (
|
|
||||||
<Chip
|
|
||||||
color="primary"
|
|
||||||
key={index}
|
|
||||||
className=""
|
|
||||||
onClose={() => {
|
|
||||||
const filteredTags = value.filter(
|
|
||||||
(tag) => tag !== item
|
|
||||||
);
|
|
||||||
if (filteredTags.length === 0) {
|
|
||||||
setError("tags", {
|
|
||||||
type: "manual",
|
|
||||||
message: "Tags tidak boleh kosong",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
clearErrors("tags");
|
|
||||||
setValue(
|
|
||||||
"tags",
|
|
||||||
filteredTags as [string, ...string[]]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item}
|
|
||||||
</Chip>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === "Enter") {
|
|
||||||
if (tag.trim() !== "") {
|
|
||||||
setValue("tags", [...value, tag.trim()]);
|
|
||||||
setTag("");
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
labelPlacement="outside"
|
|
||||||
className="w-full h-fit"
|
|
||||||
classNames={{
|
|
||||||
inputWrapper: [
|
|
||||||
"border-1 rounded-lg",
|
|
||||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
|
||||||
],
|
|
||||||
}}
|
|
||||||
variant="bordered"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<p className="text-sm mt-3">Thumbnail</p>
|
|
||||||
{files.length < 1 && (
|
|
||||||
<Fragment>
|
|
||||||
<div {...getRootProps({ className: "dropzone" })}>
|
|
||||||
<input {...getInputProps()} />
|
|
||||||
<div className=" w-full text-center border-dashed border border-default-200 dark:border-default-300 rounded-md py-[52px] flex items-center flex-col">
|
|
||||||
<CloudUploadIcon />
|
|
||||||
<h4 className=" text-2xl font-medium mb-1 mt-3 text-card-foreground/80">
|
|
||||||
Tarik file disini atau klik untuk upload.
|
|
||||||
</h4>
|
|
||||||
<div className=" text-xs text-muted-foreground">
|
|
||||||
( Upload file dengan format .jpg, .jpeg, atau
|
|
||||||
.png. Ukuran maksimal 100mb.)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{files.length > 0 && (
|
|
||||||
<div className="flex flex-row gap-2">
|
|
||||||
<Image
|
|
||||||
src={URL.createObjectURL(files[0])}
|
|
||||||
className="w-[30%]"
|
|
||||||
alt="thumbnail"
|
|
||||||
width={480}
|
|
||||||
height={480}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
className=" border-none rounded-full"
|
|
||||||
variant="bordered"
|
|
||||||
onClick={() => handleRemoveFile(files[0])}
|
|
||||||
>
|
|
||||||
<TimesIcon />
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<ModalFooter className="self-end grow items-end">
|
|
||||||
<Button color="primary" type="submit">
|
|
||||||
Simpan
|
|
||||||
</Button>
|
|
||||||
<Button color="danger" variant="light" onPress={onClose}>
|
|
||||||
Tutup
|
|
||||||
</Button>
|
|
||||||
</ModalFooter>
|
|
||||||
</form>
|
|
||||||
</ModalBody>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</ModalContent>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import FormMasterUserRole from "@/components/form/form-master-user-role";
|
import FormMasterUserRole from '@/components/form/form-master-user-role'
|
||||||
import { Card } from "@heroui/react";
|
import { Card } from '@nextui-org/react'
|
||||||
|
|
||||||
export default function CreateMasterUserRolePage() {
|
export default function CreateMasterUserRolePage() {
|
||||||
return (
|
return (
|
||||||
<Card className="h-[96vh] rounded-md bg-transparent">
|
<Card className="h-[96vh] rounded-md my- ml-3 border bg-transparent">
|
||||||
<FormMasterUserRole />
|
<FormMasterUserRole />
|
||||||
</Card>
|
</Card>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import FormDetailMasterUserRole from "@/components/form/form-detail-master-user-role";
|
import FormDetailMasterUserRole from '@/components/form/form-detail-master-user-role'
|
||||||
import { Card } from "@heroui/react";
|
import { Card } from '@nextui-org/react'
|
||||||
|
|
||||||
export default function DetailMasterRolePage() {
|
export default function DetailMasterRolePage() {
|
||||||
return (
|
return (
|
||||||
<Card className="h-[96vh] rounded-md my- ml-3 bg-transparent">
|
<Card className="h-[96vh] rounded-md my- ml-3 border bg-transparent">
|
||||||
<FormDetailMasterUserRole />
|
<FormDetailMasterUserRole />
|
||||||
</Card>
|
</Card>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,23 @@
|
||||||
"use client";
|
"use client"
|
||||||
import { AddIcon } from "@/components/icons";
|
import { AddIcon } from "@/components/icons";
|
||||||
import MasterRoleTable from "@/components/table/master-role-table";
|
import MasterRoleTable from "@/components/table/master-role-table";
|
||||||
import { Button, Card } from "@heroui/react";
|
import { Button, Card } from "@nextui-org/react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function MasterRolePage() {
|
export default function MasterRolePage() {
|
||||||
return (
|
return (
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
<div className="h-[96vh] overflow-x-hidden overflow-y-scroll gap-0 grid rounded-lg border-2 ml-4">
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
<div className="px-4">
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl py-3">
|
<Card className="rounded-md my-5 pl-5 py-2">
|
||||||
<Link href="/admin/master-role/create" className="mx-3">
|
<Link href="/admin/master-role/create">
|
||||||
<Button
|
<Button size="md" color="primary" className="w-min">
|
||||||
size="md"
|
<AddIcon />New Role
|
||||||
color="primary"
|
|
||||||
className="bg-[#F07C00] text-white"
|
|
||||||
>
|
|
||||||
Peran Baru
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
</Card>
|
||||||
|
<Card className="rounded-md my-5">
|
||||||
<MasterRoleTable />
|
<MasterRoleTable />
|
||||||
</div>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,13 @@
|
||||||
import { AddIcon } from "@/components/icons";
|
import MagazineTable from '@/components/table/magazine/magazine-table'
|
||||||
import MappingUserLevel from "@/components/table/master/master-user-level/mapping-user-level";
|
import MenuDataTable from '@/components/table/master/master-menu/menu-data/menu-data-table'
|
||||||
import MasterUserLevelTable from "@/components/table/master/master-user-level/master-user-level-table";
|
import MasterModuleTable from '@/components/table/master/master-module/master-module-table'
|
||||||
import { Button } from "@heroui/button";
|
import MasterUserLevelTable from '@/components/table/master/master-user-level/master-user-level-table'
|
||||||
import Link from "next/link";
|
import React from 'react'
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const AdminMasterUserLevel = () => {
|
const AdminMasterUserLevel = () => {
|
||||||
return (
|
return (
|
||||||
// <div>
|
<div><MasterUserLevelTable /></div>
|
||||||
// <MasterUserLevelTable />
|
)
|
||||||
// </div>
|
}
|
||||||
// <div>
|
|
||||||
// <MappingUserLevel />
|
|
||||||
// </div>
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl py-3">
|
|
||||||
<Link href="/admin/master-user-level/create" className="mx-3">
|
|
||||||
<Button
|
|
||||||
size="md"
|
|
||||||
color="primary"
|
|
||||||
className="bg-[#F07C00] text-white"
|
|
||||||
>
|
|
||||||
Pengguna Baru
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
<MasterUserLevelTable />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AdminMasterUserLevel;
|
export default AdminMasterUserLevel
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import FormMasterUser from "@/components/form/form-master-user";
|
import FormMasterUser from '@/components/form/form-master-user'
|
||||||
import { Card } from "@heroui/react";
|
import { Card } from '@nextui-org/react'
|
||||||
|
|
||||||
export default function CreateMasterUserPage() {
|
export default function CreateMasterUserPage() {
|
||||||
return (
|
return (
|
||||||
<Card className="h-[96vh] rounded-md bg-transparent">
|
<Card className="h-[96vh] rounded-md my- ml-3 border bg-transparent">
|
||||||
<FormMasterUser />
|
<FormMasterUser />
|
||||||
</Card>
|
</Card>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import FormMasterUser from "@/components/form/form-master-user";
|
|
||||||
import FormMasterUserEdit from "@/components/form/form-master-user-edit";
|
|
||||||
import { Card } from "@heroui/react";
|
|
||||||
|
|
||||||
export default function CreateMasterUserPage() {
|
|
||||||
return (
|
|
||||||
<Card className="h-[96vh] rounded-md bg-transparent">
|
|
||||||
<FormMasterUserEdit />
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +1,23 @@
|
||||||
"use client";
|
"use client"
|
||||||
import { AddIcon } from "@/components/icons";
|
import { AddIcon } from "@/components/icons";
|
||||||
import MasterUserTable from "@/components/table/master-user-table";
|
import MasterUserTable from "@/components/table/master-user-table";
|
||||||
import { Button, Card } from "@heroui/react";
|
import { Button, Card } from "@nextui-org/react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function MasterUserPage() {
|
export default function MasterUserPage() {
|
||||||
return (
|
return (
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
<div className="h-[96vh] overflow-x-hidden overflow-y-scroll gap-0 grid rounded-lg border-2 ml-4">
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
<div className="px-4">
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl py-3">
|
<Card className="rounded-md my-5 pl-5 py-2">
|
||||||
<Link href="/admin/master-user/create" className="mx-3">
|
<Link href="/admin/master-user/create">
|
||||||
<Button
|
<Button size="md" color="primary" className="w-min">
|
||||||
size="md"
|
<AddIcon />New User
|
||||||
color="primary"
|
|
||||||
className="bg-[#F07C00] text-white"
|
|
||||||
>
|
|
||||||
Pengguna Baru
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
</Card>
|
||||||
|
<Card className="rounded-md my-5">
|
||||||
<MasterUserTable />
|
<MasterUserTable />
|
||||||
</div>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
import StaticPageBuilder from "@/components/main/static-page/static-page-main";
|
|
||||||
import { Card } from "@heroui/react";
|
|
||||||
|
|
||||||
export default function StaticPageGenerator() {
|
|
||||||
return (
|
|
||||||
<div className="bg-transparent p-4 overflow-auto">
|
|
||||||
<StaticPageBuilder />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
import StaticPageBuilderEdit from "@/components/form/static-page/static-page-edit-form";
|
|
||||||
import { Card } from "@heroui/react";
|
|
||||||
|
|
||||||
export default function StaticPageEdit() {
|
|
||||||
return (
|
|
||||||
<Card className="rounded-md bg-transparent p-4 overflow-auto">
|
|
||||||
<StaticPageBuilderEdit />
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
import { AddIcon } from "@/components/icons";
|
|
||||||
import StaticPageTable from "@/components/table/static-page-table";
|
|
||||||
import { Button, Card } from "@heroui/react";
|
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
export default function StaticPageGeneratorList() {
|
|
||||||
return (
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll rounded-lg">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
|
|
||||||
<Link href="/admin/static-page/create">
|
|
||||||
<Button
|
|
||||||
size="md"
|
|
||||||
color="primary"
|
|
||||||
className="bg-[#F07C00] text-white w-full lg:w-fit"
|
|
||||||
>
|
|
||||||
Tambah Halaman
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
<StaticPageTable />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
import CreateMasterUserLevelForm from "@/components/form/master/master-user-level/master-user-level-form";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const AdminMasterUserLevelCreate = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<CreateMasterUserLevelForm />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AdminMasterUserLevelCreate;
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
import EditUserLevelForm from "@/components/form/master/master-user-level/edit-user-level-form";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const AdminMasterUserLevelCreate = () => {
|
|
||||||
return <EditUserLevelForm />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AdminMasterUserLevelCreate;
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
import { AddIcon } from "@/components/icons";
|
|
||||||
import MappingUserLevel from "@/components/table/master/master-user-level/mapping-user-level";
|
|
||||||
import MasterUserLevelTable from "@/components/table/master/master-user-level/master-user-level-table";
|
|
||||||
import { Button } from "@heroui/button";
|
|
||||||
import Link from "next/link";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const AdminMasterUserLevel = () => {
|
|
||||||
return (
|
|
||||||
<div className="overflow-x-hidden overflow-y-scroll">
|
|
||||||
<div className="px-2 md:px-4 md:py-4 w-full">
|
|
||||||
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl py-3">
|
|
||||||
<Link href="/admin/user-level/create" className="mx-3">
|
|
||||||
<Button
|
|
||||||
size="md"
|
|
||||||
color="primary"
|
|
||||||
className="bg-[#F07C00] text-white"
|
|
||||||
>
|
|
||||||
Level Baru
|
|
||||||
<AddIcon />
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
<MasterUserLevelTable />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AdminMasterUserLevel;
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
"use client";
|
|
||||||
|
|
||||||
import { AdminLayout } from "@/components/layout/admin-layout";
|
|
||||||
|
|
||||||
export default function AdminPageLayout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<AdminLayout>
|
|
||||||
{children}
|
|
||||||
</AdminLayout>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
"use client";
|
|
||||||
import PasswordForm from "@/components/form/settings/password";
|
|
||||||
import ProfileForm from "@/components/form/settings/profile";
|
|
||||||
import { close, loading } from "@/config/swal";
|
|
||||||
import { getDetailMasterUsers, getProfile } from "@/services/master-user";
|
|
||||||
import { getCookiesDecrypt } from "@/utils/global";
|
|
||||||
import { Tab, Tabs } from "@heroui/react";
|
|
||||||
import Cookies from "js-cookie";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
|
|
||||||
export default function Settings() {
|
|
||||||
const [profile, setProfile] = useState<any>();
|
|
||||||
const uid = getCookiesDecrypt("uie");
|
|
||||||
useEffect(() => {
|
|
||||||
if (!profile) {
|
|
||||||
initFetch();
|
|
||||||
}
|
|
||||||
}, [profile]);
|
|
||||||
const initFetch = async () => {
|
|
||||||
loading();
|
|
||||||
// const profile = await getDetailMasterUsers(String(uid));
|
|
||||||
const profile = await getProfile();
|
|
||||||
setProfile(profile?.data?.data);
|
|
||||||
close();
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<div className="w-full lg:w-[60%] p-3">
|
|
||||||
<div className="flex flex-col bg-gray-50 shadow-md dark:bg-stone-900 text-black dark:text-white rounded-md p-5">
|
|
||||||
<Tabs aria-label="Tabs radius" radius="sm">
|
|
||||||
<Tab key="profile" title="Profile">
|
|
||||||
<ProfileForm profile={profile} doFetch={() => initFetch()} />
|
|
||||||
</Tab>
|
|
||||||
<Tab key="music" title="Password">
|
|
||||||
<PasswordForm doFetch={() => initFetch()} />
|
|
||||||
</Tab>
|
|
||||||
</Tabs>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
|
|
||||||
export default function AuthLayout({
|
export default function AuthLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <> {children}</>;
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
import Login from "@/components/form/login";
|
import Login from '@/components/form/login'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default function AuthPage() {
|
export default function AuthPage() {
|
||||||
return <Login />;
|
return (
|
||||||
|
<Login />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return (
|
||||||
|
<div>page</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
"use client";
|
'use client'
|
||||||
|
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
|
|
||||||
export default function DocsLayout({
|
export default function DocsLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <HumasLayout>{children}</HumasLayout>;
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
|
|
||||||
|
export default function EMajalahLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
import ListEnewsPolri from '@/components/table/tabel-emajalah-polri'
|
||||||
import ListEnewsPolri from "@/components/table/tabel-emajalah-polri";
|
import React from 'react'
|
||||||
|
|
||||||
export default function ListEnewsPage() {
|
export default function ListEnewsPage() {
|
||||||
return (
|
return (
|
||||||
<HumasLayout>
|
|
||||||
<ListEnewsPolri />
|
<ListEnewsPolri />
|
||||||
</HumasLayout>
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
|
|
||||||
export default function DetailEMajalahLayout({
|
export default function DetailEMajalahLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <>{children}</>;
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,8 @@
|
||||||
"use client";
|
import EMagazineDetail from '@/components/detail/E-MagazineDetail'
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
import React from 'react'
|
||||||
import EMagazineDetail from "@/components/main/detail/e-magazine-detail";
|
|
||||||
import React, { Suspense, useEffect, useState } from "react";
|
|
||||||
|
|
||||||
export default function EnewsDetailPage() {
|
export default function EnewsDetailPage() {
|
||||||
const [hasMounted, setHasMounted] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setHasMounted(true);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Render
|
|
||||||
if (!hasMounted) return null;
|
|
||||||
return (
|
return (
|
||||||
<HumasLayout>
|
|
||||||
<Suspense>
|
|
||||||
<EMagazineDetail />
|
<EMagazineDetail />
|
||||||
</Suspense>
|
)
|
||||||
</HumasLayout>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
"use client";
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
|
||||||
|
|
||||||
export default function ApplicationLayout({
|
export default function ApplicationLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <HumasLayout>{children}</HumasLayout>;
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import FormApplication from "@/components/form/form-permohonan-informasi";
|
import FormApplication from '@/components/form/form-permohonan-informasi'
|
||||||
|
|
||||||
export default function ApplicationPage() {
|
export default function ApplicationPage() {
|
||||||
return (
|
return (
|
||||||
<div></div>
|
<FormApplication />
|
||||||
// <FormApplication />
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
"use client";
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
|
||||||
|
|
||||||
export default function KontakLayout({
|
export default function KontakLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <HumasLayout>{children}</HumasLayout>;
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
import Contact from "@/components/main/detail/contact";
|
import Contact from '@/components/detail/Contact'
|
||||||
import { Suspense } from "react";
|
|
||||||
|
|
||||||
export default function VisiMisiPage() {
|
export default function VisiMisiPage() {
|
||||||
return (
|
return (
|
||||||
<Suspense>
|
|
||||||
<Contact />
|
<Contact />
|
||||||
</Suspense>
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,9 @@
|
||||||
// RootLayout.tsx
|
|
||||||
import { fontSans } from "@/config/fonts";
|
import { fontSans } from "@/config/fonts";
|
||||||
import { siteConfig } from "@/config/site";
|
import { siteConfig } from "@/config/site";
|
||||||
import { Inter } from "next/font/google";
|
|
||||||
|
|
||||||
import "@/styles/globals.css";
|
import "@/styles/globals.css";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import { Providers } from "./providers";
|
import { Providers } from "./providers";
|
||||||
import { type ReactNode } from "react";
|
|
||||||
import LoadTawk from "@/components/ui/tawkto/load-tawk";
|
|
||||||
import LoadScript from "@/utils/loadsripct";
|
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: {
|
title: {
|
||||||
|
|
@ -29,35 +22,25 @@ export const metadata: Metadata = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<html suppressHydrationWarning className="scroll-smooth">
|
<html lang="en" suppressHydrationWarning className="scroll-smooth">
|
||||||
<head>
|
<head />
|
||||||
<meta
|
|
||||||
name="theme-color"
|
|
||||||
content="white"
|
|
||||||
media="(prefers-color-scheme: light)"
|
|
||||||
/>
|
|
||||||
<link rel="icon" href="/logohumas.png" />
|
|
||||||
<meta
|
|
||||||
name="theme-color"
|
|
||||||
content="black"
|
|
||||||
media="(prefers-color-scheme: dark)"
|
|
||||||
/>
|
|
||||||
<meta property="og:image" content="/logohumas.png" />
|
|
||||||
<link rel="manifest" href="/manifest.json" />
|
|
||||||
<link rel="apple-touch-icon" href="divhumas.png" />
|
|
||||||
<meta name="theme-color" content="#000000" />
|
|
||||||
|
|
||||||
<LoadScript />
|
|
||||||
</head>
|
|
||||||
<body
|
<body
|
||||||
className={clsx("bg-background font-sans antialiased", inter.className)}
|
className={clsx(
|
||||||
|
"bg-background font-sans antialiased",
|
||||||
|
fontSans.variable
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Providers themeProps={{ attribute: "class", defaultTheme: "light" }}>
|
<Providers themeProps={{ attribute: "class", defaultTheme: "dark" }}>
|
||||||
<main className="">{children}</main>
|
<main className="">
|
||||||
|
{children}
|
||||||
|
</main>
|
||||||
</Providers>
|
</Providers>
|
||||||
{/* <LoadTawk /> */}
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
import type { MetadataRoute } from "next";
|
|
||||||
|
|
||||||
export default function manifest(): MetadataRoute.Manifest {
|
|
||||||
return {
|
|
||||||
name: "Konten Humas",
|
|
||||||
short_name: "PWA",
|
|
||||||
description:
|
|
||||||
"DIVISI HUMAS POLRI - Pengelola Informasi dan Dokumentasi Polri.",
|
|
||||||
start_url: "/",
|
|
||||||
display: "standalone",
|
|
||||||
background_color: "#ffffff",
|
|
||||||
theme_color: "#000000",
|
|
||||||
icons: [
|
|
||||||
{
|
|
||||||
src: "/divhumas.png",
|
|
||||||
sizes: "192x192",
|
|
||||||
type: "image/png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: "/divhumas.png",
|
|
||||||
sizes: "512x512",
|
|
||||||
type: "image/png",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
|
|
||||||
|
export default function PoldaNewsLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
import ListNews from '@/components/detail/ListNews'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function PoldaNewsPage() {
|
||||||
|
return (
|
||||||
|
<ListNews />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
"use client";
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
|
|
||||||
export default function AllNewsLayout({
|
export default function AllNewsLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <>{children}</>;
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,8 @@
|
||||||
"use client";
|
import ListNews from '@/components/detail/ListNews'
|
||||||
import ListNews from "@/components/main/detail/list-news";
|
import React from 'react'
|
||||||
import React, { useEffect, useState } from "react";
|
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
|
||||||
|
|
||||||
export default function ListNewsPage() {
|
export default function ListNewsPage() {
|
||||||
const [hasMounted, setHasMounted] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setHasMounted(true);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Render
|
|
||||||
if (!hasMounted) return null;
|
|
||||||
return (
|
return (
|
||||||
<HumasLayout>
|
|
||||||
<ListNews />
|
<ListNews />
|
||||||
</HumasLayout>
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
|
|
||||||
export default function NewsLayout({
|
export default function NewsLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <>{children}</>;
|
return (
|
||||||
|
<HumasLayout>
|
||||||
|
{children}
|
||||||
|
</HumasLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,8 @@
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
import DetailPage from '@/components/detail/DetailPage'
|
||||||
import DetailPage from "@/components/main/detail/new-detail";
|
import React from 'react'
|
||||||
import { getArticleById } from "@/services/article";
|
|
||||||
import { Metadata } from "next";
|
|
||||||
|
|
||||||
type Props = {
|
export default function NewsPage() {
|
||||||
params: { id: string };
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function generateMetadata({ params }: any): Promise<Metadata> {
|
|
||||||
const res = await getArticleById(params.id?.split("-")[0]);
|
|
||||||
const article = res?.data?.data;
|
|
||||||
return {
|
|
||||||
title: article.title,
|
|
||||||
description: article.description,
|
|
||||||
openGraph: {
|
|
||||||
title: article.title,
|
|
||||||
description: article.description,
|
|
||||||
images: [`${article.thumbnailUrl}`],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function NewsPage({ params }: any) {
|
|
||||||
const articleId = params.id?.split("-")[0];
|
|
||||||
const res = await getArticleById(articleId);
|
|
||||||
const article = res?.data?.data;
|
|
||||||
return (
|
return (
|
||||||
<HumasLayout>
|
<DetailPage />
|
||||||
<DetailPage datas={article} />
|
)
|
||||||
</HumasLayout>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
export default function PoldaNewsLayout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return <>{children}</>;
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
import ListNews from "@/components/main/detail/list-news";
|
|
||||||
import React from "react";
|
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
|
||||||
|
|
||||||
export default function PoldaNewsPage() {
|
|
||||||
// return <ListNews />;
|
|
||||||
return (
|
|
||||||
<HumasLayout>
|
|
||||||
<ListNews />
|
|
||||||
</HumasLayout>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
export default function PoldaNewsLayout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return <>{children}</>;
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
import ListNews from "@/components/main/detail/list-news";
|
|
||||||
import React from "react";
|
|
||||||
import HumasLayout from "@/components/layout/humas-layout";
|
|
||||||
|
|
||||||
export default function PoldaNewsPage() {
|
|
||||||
// return <ListNews />;
|
|
||||||
return (
|
|
||||||
<HumasLayout>
|
|
||||||
<ListNews />
|
|
||||||
</HumasLayout>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
35
app/page.tsx
35
app/page.tsx
|
|
@ -1,26 +1,27 @@
|
||||||
import InstallPrompt from "@/components/install-promp";
|
'use client'
|
||||||
import BannerHumasNew from "@/components/landing/banner-new";
|
import BannerHumas from "@/components/Landing Page/BannerHumas";
|
||||||
import BodyLayout from "@/components/landing/BodyLayout";
|
import BodyLayout from "@/components/Landing Page/BodyLayout";
|
||||||
import AnalyticDrawer from "@/components/landing/drawer";
|
import HeaderNews from "@/components/Landing Page/HeaderNews";
|
||||||
import FooterNew from "@/components/landing/footer-new";
|
import { HumasLayout } from "@/components/layout/HumasLayout";
|
||||||
import HeaderNews from "@/components/landing/HeaderNews";
|
import { useEffect, useState } from "react";
|
||||||
import NewsTicker from "@/components/landing/NewsTicker";
|
|
||||||
import { Suspense } from "react";
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
|
const [hasMounted, setHasMounted] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setHasMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
if (!hasMounted) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section className="flex flex-col">
|
<HumasLayout>
|
||||||
{/* <InstallPrompt /> */}
|
<BannerHumas />
|
||||||
<NewsTicker />
|
|
||||||
<AnalyticDrawer />
|
|
||||||
<BannerHumasNew />
|
|
||||||
<HeaderNews />
|
<HeaderNews />
|
||||||
<BodyLayout />
|
<BodyLayout />
|
||||||
<Suspense>
|
</HumasLayout>
|
||||||
<FooterNew margin={true} />
|
|
||||||
</Suspense>
|
|
||||||
</section>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
import { PPIDAdminLayout } from "@/components/layout/ppid-admin-layout";
|
import { PPIDAdminLayout } from "@/components/layout/PPIDAdminLayout";
|
||||||
|
|
||||||
export default function LayoutAdmin({
|
export default function LayoutAdmin({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return <PPIDAdminLayout>{children}</PPIDAdminLayout>;
|
return (
|
||||||
|
<PPIDAdminLayout >
|
||||||
|
{children}
|
||||||
|
</PPIDAdminLayout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { PPIDLayout } from "@/components/layout/ppid-layout";
|
import { PPIDLayout } from '@/components/layout/PPIDLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React, { Children } from "react";
|
import React, { Children } from 'react'
|
||||||
|
|
||||||
export default function EPPIDPoldaLayout({
|
export default function EPPIDPoldaLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <PPIDLayout>{children}</PPIDLayout>;
|
return (
|
||||||
|
<PPIDLayout>
|
||||||
|
{children}
|
||||||
|
</PPIDLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import PPIDPolda from "@/components/layout/portal-ppid/PPIDPolda";
|
import PPIDPolda from '@/components/Portal PPID/PPIDPolda'
|
||||||
|
|
||||||
export default function PPIDSakterPage() {
|
export default function PPIDSakterPage() {
|
||||||
return <PPIDPolda />;
|
return (
|
||||||
|
<PPIDPolda />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { PPIDLayout } from "@/components/layout/ppid-layout";
|
import { PPIDLayout } from '@/components/layout/PPIDLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React, { Children } from "react";
|
import React, { Children } from 'react'
|
||||||
|
|
||||||
export default function EPPIDSatkerLayout({
|
export default function EPPIDSatkerLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <PPIDLayout>{children}</PPIDLayout>;
|
return (
|
||||||
|
<PPIDLayout>
|
||||||
|
{children}
|
||||||
|
</PPIDLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import PPIDSatker from "@/components/layout/portal-ppid/PPIDSatker";
|
import PPIDSatker from '@/components/Portal PPID/PPIDSatker'
|
||||||
|
|
||||||
export default function PPIDSakterPage() {
|
export default function PPIDSakterPage() {
|
||||||
return <PPIDSatker />;
|
return (
|
||||||
|
<PPIDSatker />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import InformasiBerkala from "@/components/table/informasi-berkala-table";
|
import InformasiBerkala from '@/components/table/informasi-berkala'
|
||||||
|
|
||||||
export default function InformasiSMPage() {
|
export default function InformasiSMPage() {
|
||||||
return <InformasiBerkala />;
|
return (
|
||||||
|
<InformasiBerkala />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { PPIDLayout } from "@/components/layout/ppid-layout";
|
import { PPIDLayout } from '@/components/layout/PPIDLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React, { Children } from "react";
|
import React, { Children } from 'react'
|
||||||
|
|
||||||
export default function InfoPublicLayout({
|
export default function InfoPublicLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <PPIDLayout>{children}</PPIDLayout>;
|
return (
|
||||||
|
<PPIDLayout>
|
||||||
|
{children}
|
||||||
|
</PPIDLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { PPIDLayout } from "@/components/layout/ppid-layout";
|
import { PPIDLayout } from '@/components/layout/PPIDLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React, { Children } from "react";
|
import React, { Children } from 'react'
|
||||||
|
|
||||||
export default function LayananInformasiLayout({
|
export default function LayananInformasiLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <PPIDLayout>{children}</PPIDLayout>;
|
return (
|
||||||
|
<PPIDLayout>
|
||||||
|
{children}
|
||||||
|
</PPIDLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import FormObjectionRequest from "@/components/form/form-permohonan-keberatan";
|
import FormObjectionRequest from '@/components/form/form-permohonan-keberatan'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function PermohonanKeberanatan() {
|
export default function PermohonanKeberanatan() {
|
||||||
return (
|
return (
|
||||||
<div></div>
|
<FormObjectionRequest />
|
||||||
// <FormObjectionRequest />
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import FormApplication from "@/components/form/form-permohonan-informasi";
|
import FormApplication from '@/components/form/form-permohonan-informasi'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function RegistrasiPage() {
|
export default function RegistrasiPage() {
|
||||||
return (
|
return (
|
||||||
<div></div>
|
<FormApplication />
|
||||||
// <FormApplication />
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import StatiticAndRecap from "@/components/main/detail/statistic-recap";
|
import StatiticAndRecap from '@/components/detail/StatistikRekapitulas'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function StatisticPage() {
|
export default function StatisticPage() {
|
||||||
return <StatiticAndRecap />;
|
return (
|
||||||
|
<StatiticAndRecap />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
"use client";
|
'use client'
|
||||||
|
import FooterPPID from '@/components/Portal PPID/FooterPPID';
|
||||||
|
import PPIDbody from '@/components/Portal PPID/PpidMain';
|
||||||
|
import PPIDBanner from '@/components/Portal PPID/ppid-banner';
|
||||||
|
import NavbarPPID from '@/components/navbar/NavbarPPID';
|
||||||
|
import { usePathname } from 'next/navigation';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
|
||||||
import NavbarPPID from "@/components/layout/navbar/NavbarPPID";
|
|
||||||
import FooterPPID from "@/components/layout/portal-ppid/FooterPPID";
|
|
||||||
import PPIDBanner from "@/components/layout/portal-ppid/ppid-banner";
|
|
||||||
import PPIDbody from "@/components/layout/portal-ppid/PpidMain";
|
|
||||||
import { usePathname } from "next/navigation";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function PortalPPID(url: any) {
|
export default function PortalPPID(url: any) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
@ -18,5 +19,5 @@ export default function PortalPPID(url: any) {
|
||||||
<PPIDbody />
|
<PPIDbody />
|
||||||
<FooterPPID />
|
<FooterPPID />
|
||||||
</>
|
</>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import InformasiBerkala from "@/components/table/informasi-berkala-table";
|
import InformasiBerkala from '@/components/table/informasi-berkala'
|
||||||
|
|
||||||
export default function InformasiSMPage() {
|
export default function InformasiSMPage() {
|
||||||
return <InformasiBerkala />;
|
return (
|
||||||
|
<InformasiBerkala />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { SatkerLayout } from "@/components/layout/satker-layout";
|
import { SatkerLayout } from '@/components/layout/SatKerLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React from "react";
|
import React from 'react';
|
||||||
|
|
||||||
export default function DinamicSatkerLayout({
|
export default function DinamicSatkerLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
// const pathname = usePathname();
|
// const pathname = usePathname();
|
||||||
// console.log(pathname)
|
// console.log(pathname)
|
||||||
|
|
||||||
return <SatkerLayout>{children}</SatkerLayout>;
|
return (
|
||||||
|
<SatkerLayout>
|
||||||
|
{children}
|
||||||
|
</SatkerLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { SatkerLayout } from "@/components/layout/satker-layout";
|
import { SatkerLayout } from '@/components/layout/SatKerLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React from "react";
|
import React from 'react';
|
||||||
|
|
||||||
export default function LayananInformasiLayout({
|
export default function LayananInformasiLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <SatkerLayout>{children}</SatkerLayout>;
|
return (
|
||||||
|
<SatkerLayout>
|
||||||
|
{children}
|
||||||
|
</SatkerLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import StatiticAndRecap from "@/components/main/detail/statistic-recap";
|
import StatiticAndRecap from '@/components/detail/StatistikRekapitulas'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function StatisticPage() {
|
export default function StatisticPage() {
|
||||||
return <StatiticAndRecap />;
|
return (
|
||||||
|
<StatiticAndRecap />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,24 @@
|
||||||
"use client";
|
'use client'
|
||||||
|
import PPIDSatkerMain from '@/components/Portal PPID/PPIDMainSatker';
|
||||||
import FooterSatker from "@/components/layout/navbar/FooterSatker";
|
import PPIDBanner from '@/components/Portal PPID/ppid-banner';
|
||||||
import NavbarSatker from "@/components/layout/navbar/NavbarSatker";
|
import FooterSatker from '@/components/navbar/FooterSatker';
|
||||||
import PPIDBanner from "@/components/layout/portal-ppid/ppid-banner";
|
import NavbarSatker from '@/components/navbar/NavbarSatker';
|
||||||
import PPIDSatkerMain from "@/components/layout/portal-ppid/PPIDMainSatker";
|
import { usePathname } from 'next/navigation';
|
||||||
import { usePathname } from "next/navigation";
|
import React from 'react'
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function PoldaPage() {
|
export default function PoldaPage() {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const url: string = pathname
|
const url: string = pathname.split('polda/')[1].replace(/-/g, ' ').toUpperCase();
|
||||||
.split("polda/")[1]
|
|
||||||
.replace(/-/g, " ")
|
|
||||||
.toUpperCase();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="text-black">
|
<div className='text-black'>
|
||||||
<div className="text-black">
|
<div className='text-black'>
|
||||||
<NavbarSatker />
|
<NavbarSatker />
|
||||||
<PPIDBanner url={url} />
|
<PPIDBanner url={url} />
|
||||||
<PPIDSatkerMain />
|
<PPIDSatkerMain />
|
||||||
<FooterSatker />
|
<FooterSatker />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { SatkerLayout } from "@/components/layout/satker-layout";
|
import { SatkerLayout } from '@/components/layout/SatKerLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React from "react";
|
import React from 'react';
|
||||||
|
|
||||||
export default function DinamicSatkerLayout({
|
export default function DinamicSatkerLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
// const pathname = usePathname();
|
// const pathname = usePathname();
|
||||||
// console.log(pathname)
|
// console.log(pathname)
|
||||||
|
|
||||||
return <SatkerLayout>{children}</SatkerLayout>;
|
return (
|
||||||
|
<SatkerLayout>
|
||||||
|
{children}
|
||||||
|
</SatkerLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import About from "@/components/main/detail/about";
|
import About from '@/components/detail/About'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function PPIDProfile() {
|
export default function PPIDProfile() {
|
||||||
return <About />;
|
return (
|
||||||
|
<About />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import HistoryPPID from "@/components/page/history-ppid";
|
import HistoryPPID from '@/components/page/HistoryPPID'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function PPIDProfilePage() {
|
export default function PPIDProfilePage() {
|
||||||
return <HistoryPPID />;
|
return (
|
||||||
|
<HistoryPPID />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import StrukturOrganisasi from "@/components/main/detail/structure";
|
import StrukturOrganisasi from "@/components/detail/StrukturOrganisasi";
|
||||||
|
|
||||||
export default function StructurePPID() {
|
export default function StructurePPID() {
|
||||||
return <StrukturOrganisasi />;
|
return (
|
||||||
|
<StrukturOrganisasi />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import Task from "@/components/main/detail/task-detail";
|
import Task from "@/components/detail/TaskDetail";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function PPIDTask() {
|
export default function PPIDTask() {
|
||||||
return <Task />;
|
return (
|
||||||
|
<Task />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import VisiMisi from "@/components/main/detail/visi-misi";
|
import VisiMisi from '@/components/detail/VisiMisi'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function VMPPID() {
|
export default function VMPPID() {
|
||||||
return <VisiMisi />;
|
return (
|
||||||
|
<VisiMisi />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { SatkerLayout } from "@/components/layout/satker-layout";
|
import { SatkerLayout } from '@/components/layout/SatKerLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React from "react";
|
import React from 'react';
|
||||||
|
|
||||||
export default function RegulasiLayout({
|
export default function RegulasiLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <SatkerLayout>{children}</SatkerLayout>;
|
return (
|
||||||
|
<SatkerLayout>
|
||||||
|
{children}
|
||||||
|
</SatkerLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
import PPIDSidebar from "@/components/layout/portal-ppid/PPIDSidebar";
|
import PPIDSidebar from '@/components/Portal PPID/PPIDSidebar'
|
||||||
import RegulationTable from "@/components/table/tabel-regulasi";
|
import RegulationTable from '@/components/table/tabel-regulasi'
|
||||||
|
|
||||||
export default function RegulasiPage() {
|
export default function RegulasiPage() {
|
||||||
return (
|
return (
|
||||||
<div className="md:flex">
|
<div className='md:flex'>
|
||||||
<div className="w-auto bg-[#E2E2E2] md:w-2/3 lg:w-[75%] px-2 md:px-0 lg:px-5">
|
<div className='w-auto bg-[#E2E2E2] md:w-2/3 lg:w-[75%] px-2 md:px-0 lg:px-5'>
|
||||||
<RegulationTable />
|
<RegulationTable />
|
||||||
</div>
|
</div>
|
||||||
<div className="w-auto md:w-1/3 lg:w-[25%]">
|
<div className='w-auto md:w-1/3 lg:w-[25%]'>
|
||||||
<PPIDSidebar />
|
<PPIDSidebar />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import ServiceFlow from "@/components/main/detail/service-flow";
|
import ServiceFlow from '@/components/detail/ServiceFlow'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function ServiceFlowPage() {
|
export default function ServiceFlowPage() {
|
||||||
return <ServiceFlow />;
|
return (
|
||||||
|
<ServiceFlow />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { PPIDLayout } from "@/components/layout/ppid-layout";
|
import { PPIDLayout } from '@/components/layout/PPIDLayout';
|
||||||
import { SatkerLayout } from "@/components/layout/satker-layout";
|
import { SatkerLayout } from '@/components/layout/SatKerLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React, { Children } from "react";
|
import React, { Children } from 'react'
|
||||||
|
|
||||||
export default function StandarLayananLayout({
|
export default function StandarLayananLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <SatkerLayout>{children}</SatkerLayout>;
|
return (
|
||||||
|
<SatkerLayout>
|
||||||
|
{children}
|
||||||
|
</SatkerLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import ServiceAnnouncement from "@/components/main/detail/service-announcement";
|
import ServiceAnnouncement from '@/components/detail/ServiceAnnouncement'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function ServiceAnnouncePage() {
|
export default function ServiceAnnouncePage() {
|
||||||
return <ServiceAnnouncement />;
|
return (
|
||||||
|
<ServiceAnnouncement />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import ObjectionMecanism from "@/components/main/detail/objection-mecanism";
|
import ObjectionMecanism from '@/components/detail/ObjectionMecanism'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function ObjectionMecanismPage() {
|
export default function ObjectionMecanismPage() {
|
||||||
return <ObjectionMecanism />;
|
return (
|
||||||
|
<ObjectionMecanism />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import RequestDispute from "@/components/main/detail/reqeust-dispute";
|
import RequestDispute from '@/components/detail/RequestDispute'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function RequestDisputePage() {
|
export default function RequestDisputePage() {
|
||||||
return <RequestDispute />;
|
return (
|
||||||
|
<RequestDispute />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import ServiceFee from "@/components/main/detail/service-fee";
|
import ServiceFee from '@/components/detail/ServiceFee'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function ServiceFeePage() {
|
export default function ServiceFeePage() {
|
||||||
return <ServiceFee />;
|
return (
|
||||||
|
<ServiceFee />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import RequestInformation from "@/components/main/detail/request-information";
|
import RequestInformation from '@/components/detail/RequestInformation'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function RequestInformationPage() {
|
export default function RequestInformationPage() {
|
||||||
return <RequestInformation />;
|
return (
|
||||||
|
<RequestInformation />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import ServiceTime from "@/components/main/detail/serive-time";
|
import ServiceTime from '@/components/detail/ServiceTime'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function ServiceTimePage() {
|
export default function ServiceTimePage() {
|
||||||
return <ServiceTime />;
|
return (
|
||||||
|
<ServiceTime />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
"use client";
|
'use client'
|
||||||
import { PPIDLayout } from "@/components/layout/ppid-layout";
|
import { PPIDLayout } from '@/components/layout/PPIDLayout';
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from 'next/navigation';
|
||||||
import React, { Children } from "react";
|
import React, { Children } from 'react'
|
||||||
|
|
||||||
export default function PPIDProfileLayout({
|
export default function PPIDProfileLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
console.log(pathname);
|
console.log(pathname)
|
||||||
|
|
||||||
return <PPIDLayout>{children}</PPIDLayout>;
|
return (
|
||||||
|
<PPIDLayout>
|
||||||
|
{children}
|
||||||
|
</PPIDLayout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import About from "@/components/main/detail/about";
|
import About from '@/components/detail/About'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function PPIDProfile() {
|
export default function PPIDProfile() {
|
||||||
return <About />;
|
return (
|
||||||
|
<About />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import HistoryPPID from "@/components/page/history-ppid";
|
import HistoryPPID from '@/components/page/HistoryPPID'
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
|
|
||||||
export default function PPIDProfilePage() {
|
export default function PPIDProfilePage() {
|
||||||
return <HistoryPPID />;
|
return (
|
||||||
|
<HistoryPPID />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import StrukturOrganisasi from "@/components/main/detail/structure";
|
import StrukturOrganisasi from "@/components/detail/StrukturOrganisasi";
|
||||||
|
|
||||||
export default function StructurePPID() {
|
export default function StructurePPID() {
|
||||||
return <StrukturOrganisasi />;
|
return (
|
||||||
|
<StrukturOrganisasi />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue