"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; import type { Award } from "@/payload-types"; import { Button } from "@/components/ui/button"; import { AwardPickerDialog } from "./AwardPickerDialog"; import { AwardIcon, PlusIcon } from "lucide-react"; interface ProfileGrantAwardButtonProps { userId: number; username: string; awards: Award[]; } /** * Profile-page section that lets viewers grant an award to the profile owner. * Eligibility is enforced server-side (getGrantStats / grantAward inside * GrantAwardDialog) — this component only provides the entry point. */ export function ProfileGrantAwardButton({ userId, username, awards }: ProfileGrantAwardButtonProps) { const [open, setOpen] = useState(false); const router = useRouter(); return (

Grant Award

router.refresh()} />
); }