"use client"; import EditableText from "@/components/editable-text"; import { LocalEditor } from "@/components/editor"; import { Button } from "@/components/ui/button"; import useApiMutation from "@/hooks/use-api"; import sluggify from "@/lib/sluggify"; import { NewBlog } from "@/types/types"; import { useMemo, useState } from "react"; export default function BlogEditor() { const [title, setTitle] = useState(""); const slug = useMemo(() => sluggify(title), [title]); const { trigger: newBlog, isMutating: loading, isSuccess, } = useApiMutation( "/blog/new", undefined, "POST", true, false, ); const content = localStorage.getItem("blog_draft") ?? ""; return (
{/* This div should have a proper layout, ONLY PART TO BE MODIFIED*/}
{/*Should have an image or a placeholder that opens a dialog when clicked on to set the url of an image.*/}

{title}

{slug}

{/*Should have a summary input box or textarea*/}
); }