import { Button } from "@/components/ui/button"; import { createClient } from "@/lib/supabase/server"; import { ChevronLeftIcon } from "lucide-react"; import Link from "next/link"; import Polls from "./_components/polls"; interface PageProps { params: Promise<{ id: string; memberId: string }>; } export default async function Page(props: PageProps) { const { id, memberId } = await props.params; const supabase = await createClient(); const { data: polls } = await supabase.from("polls").select().eq("id", id); const { data: members } = await supabase .from("poll_members") .select() .eq("poll_id", id) .eq("id", parseInt(memberId)); const { data: choices } = await supabase .from("poll_choices") .select() .eq("poll_id", id); if (!polls || polls.length === 0) { return
Poll not found
; } if (!members || members.length === 0) { return (
Member not found
); } const [poll] = polls; const [member] = members; return (

{poll.name}

({ id: c.id, name: c.name, picture: c.picture, distance: c.distance || undefined, }))} />
); }