feat: add Discord profile dropdown menu with role display and integrate with admin and form layouts via AdminShellServer.

This commit is contained in:
2026-07-03 23:02:15 +07:00 Unverified
parent 6cb28421e6
commit ac6c35598c
12 changed files with 413 additions and 83 deletions
+23 -2
View File
@@ -38,6 +38,7 @@ import Image from 'next/image';
import { RichTextEditor } from "@/components/rich-text-editor";
import { FormattedText } from "@/components/formatted-text";
import { ThemeToggle } from "@/components/theme-toggle";
import { DropdownMenuAvatar, DiscordMemberProfile } from "@/components/dropdown-menu-avatar";
interface Question {
id: string;
@@ -609,7 +610,17 @@ function AnswerPreview({ question }: { question: Question }) {
);
}
export function AdminSidebar({ formId }: { formId: string }) {
export function AdminSidebar({
formId,
userName,
userImage,
profile,
}: {
formId: string;
userName?: string;
userImage?: string;
profile?: DiscordMemberProfile | null;
}) {
const pathname = usePathname();
return (
@@ -618,7 +629,17 @@ export function AdminSidebar({ formId }: { formId: string }) {
<span className="font-bold tracking-wider text-primary text-sm uppercase">
Form Admin
</span>
<ThemeToggle />
<div className="flex items-center gap-1">
{(userName || profile) && (
<DropdownMenuAvatar
userName={userName || ""}
userImage={userImage || ""}
profile={profile || null}
showName={false}
/>
)}
<ThemeToggle />
</div>
</SidebarHeader>
<SidebarContent>