This commit is contained in:
cdricms
2025-02-20 20:09:43 +01:00
parent 5bdfc9ce06
commit dbddf12f25
3 changed files with 16 additions and 15 deletions

View File

@@ -1,12 +1,8 @@
"use client";
import { Editor } from "@/components/editor";
import { Button } from "@/components/ui/button";
import useApiMutation from "@/hooks/use-api";
import dynamic from "next/dynamic";
const Editor = dynamic(
() => import("@/components/editor").then((mod) => mod.Editor),
{ ssr: false },
);
import { useState } from "react";
export default function BlogEditor() {
const {
@@ -29,7 +25,7 @@ export default function BlogEditor() {
className="text-black bg-white"
onClick={async () => {
try {
const blogContent = localStorage.getItem("blog_draft");
// const blogContent = localStorage.getItem("blog_draft");
const res = await trigger({
label: "This is my label",
summary: "A summary",
@@ -37,7 +33,7 @@ export default function BlogEditor() {
href: "none",
blogID: "id",
slug: "myslug",
content: blogContent,
// content: blogContent,
published: "",
});
if (!res)

View File

@@ -1,9 +1,14 @@
import Editor from "./editor"
"use client";
import dynamic from "next/dynamic";
export default function NewBlog() {
const Editor = dynamic(() => import("./editor").then((mod) => mod.default), {
ssr: false,
});
export default async function NewBlog() {
return (
<>
<Editor />
<>
<Editor />
</>
)
);
}