diff --git a/components/editor/custom-editor.js b/components/editor/custom-editor.js
index d2a16e4..12ed008 100644
--- a/components/editor/custom-editor.js
+++ b/components/editor/custom-editor.js
@@ -2,40 +2,213 @@
import React from "react";
import { CKEditor } from "@ckeditor/ckeditor5-react";
-import Editor from "@/vendor/ckeditor5/build/ckeditor";
+import Editor from "ckeditor5-custom-build";
function CustomEditor(props) {
+ const maxHeight = props.maxHeight || 600;
+
return (
-
{
- const data = editor.getData();
- console.log({ event, editor, data });
- props.onChange(data);
- }}
- config={{
- toolbar: [
- "heading",
- "fontsize",
- "bold",
- "italic",
- "link",
- "numberedList",
- "bulletedList",
- "undo",
- "redo",
- "alignment",
- "outdent",
- "indent",
- "blockQuote",
- "insertTable",
- "codeBlock",
- "sourceEditing",
- ],
- }}
- />
+
+ {
+ const data = editor.getData();
+ console.log({ event, editor, data });
+ props.onChange(data);
+ }}
+ config={{
+ toolbar: [
+ "heading",
+ "fontsize",
+ "bold",
+ "italic",
+ "link",
+ "numberedList",
+ "bulletedList",
+ "undo",
+ "redo",
+ "alignment",
+ "outdent",
+ "indent",
+ "blockQuote",
+ "insertTable",
+ "codeBlock",
+ "sourceEditing",
+ ],
+ content_style: `
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
+ font-size: 14px;
+ line-height: 1.6;
+ color: #111 !important;
+ background: #fff !important;
+ margin: 0;
+ padding: 1rem;
+ }
+ p {
+ margin: 0.5em 0;
+ }
+ h1, h2, h3, h4, h5, h6 {
+ margin: 1em 0 0.5em 0;
+ color: inherit !important;
+ }
+ ul, ol {
+ margin: 0.5em 0;
+ padding-left: 2em;
+ }
+ blockquote {
+ margin: 1em 0;
+ padding: 0.5em 1em;
+ border-left: 4px solid #d1d5db;
+ background-color: #f9fafb;
+ color: inherit !important;
+ }
+ `,
+ height: props.height || 400,
+ removePlugins: ["Title"],
+ mobile: {
+ theme: "silver",
+ },
+ }}
+ />
+
+
);
}
export default CustomEditor;
+
+// // components/custom-editor.js
+
+// import React from "react";
+// import { CKEditor } from "@ckeditor/ckeditor5-react";
+// import Editor from "@/vendor/ckeditor5/build/ckeditor";
+
+// function CustomEditor(props) {
+// return (
+// {
+// const data = editor.getData();
+// console.log({ event, editor, data });
+// props.onChange(data);
+// }}
+// config={{
+// toolbar: [
+// "heading",
+// "fontsize",
+// "bold",
+// "italic",
+// "link",
+// "numberedList",
+// "bulletedList",
+// "undo",
+// "redo",
+// "alignment",
+// "outdent",
+// "indent",
+// "blockQuote",
+// "insertTable",
+// "codeBlock",
+// "sourceEditing",
+// ],
+// }}
+// />
+// );
+// }
+
+// export default CustomEditor;
diff --git a/components/editor/view-editor.js b/components/editor/view-editor.js
index 96c53c3..2dae74e 100644
--- a/components/editor/view-editor.js
+++ b/components/editor/view-editor.js
@@ -1,39 +1,18 @@
-// import React from "react";
-// import { CKEditor } from "@ckeditor/ckeditor5-react";
-// import Editor from "@/vendor/ckeditor5/build/ckeditor";
-
-// function ViewEditor(props) {
-// return (
-//
-// );
-// }
-
-// export default ViewEditor;
-
import React from "react";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import Editor from "@/vendor/ckeditor5/build/ckeditor";
-function ViewEditor({ initialData }) {
+function ViewEditor(props) {
return (
-
-
-
+
);
}
diff --git a/components/form/categories/categories-update-form.tsx b/components/form/categories/categories-update-form.tsx
index 856e7cb..cf893ba 100644
--- a/components/form/categories/categories-update-form.tsx
+++ b/components/form/categories/categories-update-form.tsx
@@ -122,11 +122,28 @@ export default function CategoriesUpdateForm() {
// 🔹 hanya kirim data mandatory
const payload = {
id: formData.id,
- description: formData.description || "",
- statusId: formData.statusId || 1,
- title: formData.title || "",
+ title: formData.title,
+ description: formData.description,
+ statusId: formData.statusId,
+
+ // ⬇️ FIELD KRUSIAL (WAJIB)
+ isActive: true,
+ is_active: true,
+ isPublish: formData.isPublish,
+ publishedAt: formData.publishedAt,
+ parentId: formData.parentId,
+ slug: formData.slug,
+ createdById: formData.createdById,
};
+ // const payload = {
+ // id: formData.id,
+ // description: formData.description || "",
+ // statusId: formData.statusId || 1,
+ // title: formData.title || "",
+ // };
+ console.log("UPDATE PAYLOAD:", payload);
+
const res = await updateArticleCategory(Number(id), payload);
if (!res?.error) {
diff --git a/components/landing-page/category.tsx b/components/landing-page/category.tsx
index 591bd1e..1bd0eba 100644
--- a/components/landing-page/category.tsx
+++ b/components/landing-page/category.tsx
@@ -56,7 +56,7 @@ export default function Category() {
return (
-
+
{loading
? t("loadCategory")
@@ -89,7 +89,7 @@ export default function Category() {
return (