30 lines
909 B
TypeScript
30 lines
909 B
TypeScript
import { getI18n } from "@/lib/i18n";
|
|
import { Header, Footer } from "@/components/Shell";
|
|
import { DraftEditor } from "@/components/DraftEditor";
|
|
import { user } from "@/lib/supabase";
|
|
import { accountProfile } from "@/lib/profile";
|
|
import { redirect } from "next/navigation";
|
|
export default async function Draft({
|
|
params,
|
|
}: {
|
|
params: Promise<{ id: string }>;
|
|
}) {
|
|
const { t } = await getI18n();
|
|
const { id } = await params;
|
|
const account = await user();
|
|
if (!account)
|
|
redirect(`/log-in?next=${encodeURIComponent("/dashboard/" + id)}`);
|
|
const profile = await accountProfile(account);
|
|
return (
|
|
<>
|
|
<Header />
|
|
<main className="section page-content">
|
|
<span className="eyebrow">{t("YOUR WORLD · YOUR LOCATIONS")}</span>
|
|
<h1>{t("Map workshop")}</h1>
|
|
<DraftEditor id={id} hostName={profile.display_name} />
|
|
</main>
|
|
<Footer />
|
|
</>
|
|
);
|
|
}
|