Merge pull request #104 from madhura68/feat/story-0vtnydpi

ST-1210: S3 — Frontend: Chat & Timeline tab UI
This commit is contained in:
Janpeter Visser 2026-05-05 17:41:53 +02:00 committed by GitHub
commit c3f10cccce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View file

@ -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 ( return (
<IdeaDetailLayout <IdeaDetailLayout
idea={ideaToDto(idea)} idea={ideaToDto(idea)}
@ -91,6 +98,13 @@ export default async function IdeaDetailPage({ params, searchParams }: PageProps
created_at: q.created_at.toISOString(), created_at: q.created_at.toISOString(),
expires_at: q.expires_at.toISOString(), expires_at: q.expires_at.toISOString(),
}))} }))}
userQuestions={userQuestionsRaw.map((uq) => ({
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} isDemo={session.isDemo ?? false}
initialTab={tab ?? 'idee'} initialTab={tab ?? 'idee'}
/> />

View file

@ -71,6 +71,14 @@ interface ProductOption {
repo_url: string | null repo_url: string | null
} }
export interface IdeaUserQuestionDto {
id: string
question: string
answer: string | null
status: 'pending' | 'answered'
created_at: string
}
interface Props { interface Props {
idea: IdeaDto idea: IdeaDto
grill_md: string | null grill_md: string | null
@ -78,6 +86,7 @@ interface Props {
products: ProductOption[] products: ProductOption[]
logs: IdeaLog[] logs: IdeaLog[]
questions: IdeaQuestion[] questions: IdeaQuestion[]
userQuestions: IdeaUserQuestionDto[]
isDemo: boolean isDemo: boolean
initialTab: string initialTab: string
} }
@ -89,6 +98,7 @@ export function IdeaDetailLayout({
products, products,
logs, logs,
questions, questions,
userQuestions,
isDemo, isDemo,
initialTab, initialTab,
}: Props) { }: Props) {