diff --git a/app/admin/(dashboard)/authors/[name]/edit/page.tsx b/app/admin/(dashboard)/authors/[name]/edit/page.tsx new file mode 100644 index 0000000..949f016 --- /dev/null +++ b/app/admin/(dashboard)/authors/[name]/edit/page.tsx @@ -0,0 +1,116 @@ +import { createClient } from "@/utils/supabase/server"; +import { notFound } from "next/navigation"; +import { updateAuthor } from "../../actions"; + +interface PageProps { + params: Promise<{ name: string }>; +} + +export default async function EditAuthorPage({ params }: PageProps) { + const { name } = await params; + const decodedName = decodeURIComponent(name); + const supabase = await createClient(); + + const { data: author, error } = await supabase + .from("authors") + .select("name, bio, x_link, fb_link, insta_link, pfp_link") + .eq("name", decodedName) + .single(); + + if (error || !author) { + notFound(); + } + + return ( +
+

Edit Author

+
+
+ +
+ + +
+
+ +