Files
thoughts/thoughts-frontend/app/settings/profile/page.tsx
Gabriel Kaszewski 442a61bbdb
Some checks failed
lint / lint (push) Failing after 9m28s
test / unit (push) Successful in 16m8s
feat: add optional mood to thoughts with custom moods support
Mood is an optional label+emoji string (e.g. "relaxed 😌") on thoughts.
Users can define up to 8 custom moods in profile settings.
Mood federates via AP Note JSON and displays on thought cards.
2026-05-29 15:38:35 +02:00

40 lines
1.1 KiB
TypeScript

// app/settings/profile/page.tsx
import type { Metadata } from "next";
import { cookies } from "next/headers";
export const metadata: Metadata = {
title: "Edit profile",
description: "Update your Thoughts profile",
};
import { redirect } from "next/navigation";
import { getMe } from "@/lib/api";
import { EditProfileForm } from "@/components/edit-profile-form";
import { CustomMoodsEditor } from "@/components/custom-moods-editor";
export default async function EditProfilePage() {
const token = (await cookies()).get("auth_token")?.value;
if (!token) {
redirect("/login");
}
const me = await getMe(token).catch(() => null);
if (!me) {
redirect("/login");
}
return (
<div className="space-y-6 ">
<div className="glass-effect glossy-effect bottom rounded-md shadow-fa-lg p-4">
<h3 className="text-lg font-medium">Profile</h3>
<p className="text-sm text-muted-foreground">
This is how others will see you on the site.
</p>
</div>
<EditProfileForm currentUser={me} token={token} />
<CustomMoodsEditor initial={me.customMoods} />
</div>
);
}