diff --git a/app/(app)/ideas/[id]/page.tsx b/app/(app)/ideas/[id]/page.tsx index 0d25fb7..0c1cfb0 100644 --- a/app/(app)/ideas/[id]/page.tsx +++ b/app/(app)/ideas/[id]/page.tsx @@ -69,6 +69,13 @@ export default async function IdeaDetailPage({ params, searchParams }: PageProps }, }) + const userQuestionsRaw = await prisma.userQuestion.findMany({ + where: { idea_id: id }, + orderBy: { created_at: 'asc' }, + take: 100, + select: { id: true, question: true, answer: true, status: true, created_at: true }, + }) + return ( ({ + id: uq.id, + question: uq.question, + answer: uq.answer, + status: uq.status as 'pending' | 'answered', + created_at: uq.created_at.toISOString(), + }))} isDemo={session.isDemo ?? false} initialTab={tab ?? 'idee'} /> diff --git a/components/ideas/idea-detail-layout.tsx b/components/ideas/idea-detail-layout.tsx index 0e12ac8..a10c968 100644 --- a/components/ideas/idea-detail-layout.tsx +++ b/components/ideas/idea-detail-layout.tsx @@ -71,6 +71,14 @@ interface ProductOption { repo_url: string | null } +export interface IdeaUserQuestionDto { + id: string + question: string + answer: string | null + status: 'pending' | 'answered' + created_at: string +} + interface Props { idea: IdeaDto grill_md: string | null @@ -78,6 +86,7 @@ interface Props { products: ProductOption[] logs: IdeaLog[] questions: IdeaQuestion[] + userQuestions: IdeaUserQuestionDto[] isDemo: boolean initialTab: string } @@ -89,6 +98,7 @@ export function IdeaDetailLayout({ products, logs, questions, + userQuestions, isDemo, initialTab, }: Props) {