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 (
<IdeaDetailLayout
idea={ideaToDto(idea)}
@ -91,6 +98,13 @@ export default async function IdeaDetailPage({ params, searchParams }: PageProps
created_at: q.created_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}
initialTab={tab ?? 'idee'}
/>

View file

@ -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) {