Files
supabase/apps/www/components/Contribute/ThreadContent.tsx
T
0b8db9adc1 Feat(www)/contribute (#40966)
* Rough contribute ui

* Clean up filter area

* Tweak query with new threads schema

* Unify table and apply some ui nits

* Fix types issues

* Setup types

* FilterS

* Fix filters

* Make search global

* Add icons for table rows

* Add single thread view

* Loading state for threads

* Fix icon colors

* Add leaderboard

* Fix conversation text overflow and add op badge

* Rename leaderboard

* Turn of leaderboard

* Formatting

* Remove other from product areas

* And from stacks

* Prettier types

* Start contribute/about

* About cards

* Add avatar component

* Polish up about page

* Nudges

* Add application form

* Add squad form

* Change to last 30 days instead of 24hrs

* Responsive nudges

* Format components for conversation view

* Re use ui components on about page

* Fix prettier errors

* Filter nudges

* chore(www): improve contribute UI (#41481)

* hero tweaks

* better table

* wrap post time

* nip and tuck

* use table component

* use table component

* Add menu item

* Alan/polish contribute filtering UI (#41504)

* polishing tabs

* nits in tables

* nit in filtering

* nits

* ship it

* fix selection style

* nit search bar

* Add view for authors

* Format author page

* Add contribute menu item

* Tidy up about page

* More about page edits

* Update

* basics

* copy cleanup

* improvements to thread table

* threads improvements

* remove extraneous div

* thread improvements

* chore(www): improve contribute UI (#41605)

* basics

* improvements to thread table

* threads improvements

* remove extraneous div

* thread improvements

* Add feature flag for contribute page

* Add feature flag for contribute page

* Fix ts error

* Thread view nudges

* Undo env change

* Cleanup

* Cleanup

* Typos

---------

Co-authored-by: Tomas Pozo <tomaspozogarzon@gmail.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
Co-authored-by: Alan Daniel <stylesshjs@gmail.com>
2026-01-07 14:48:23 -03:30

67 lines
2.3 KiB
TypeScript

import { notFound } from 'next/navigation'
import { Suspense } from 'react'
import { Badge } from 'ui'
import { Conversation } from '~/components/Contribute/Conversation'
import { HelpOnPlatformButton } from '~/components/Contribute/HelpOnPlatformButton'
import { getThreadById } from '~/data/contribute'
import Loading from '../../app/contribute/t/[id]/loading'
export async function ThreadContent({ id }: { id: string }) {
const thread = await getThreadById(id)
if (!thread) {
notFound()
}
return (
<div className="grid gap-6">
{/* Conversation Section (includes title, question, and first reply) */}
<Suspense fallback={<Loading />}>
<Conversation thread={thread} />
</Suspense>
{/* Metadata and Actions Section */}
<div className="border border-border rounded-lg p-6 bg-surface-200">
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 mb-6 pb-6 border-b border-border">
{thread.product_areas.filter((area: string) => area !== 'Other').length > 0 && (
<div>
<h3 className="text-sm font-medium text-foreground mb-2">Product areas</h3>
<div className="flex flex-wrap gap-2">
{thread.product_areas
.filter((area: string) => area !== 'Other')
.map((area: string) => (
<Badge key={area} variant="default">
{area}
</Badge>
))}
</div>
</div>
)}
{thread.stack.filter((tech: string) => tech !== 'Other').length > 0 && (
<div>
<h3 className="text-sm font-medium text-foreground mb-2">Stack</h3>
<div className="flex flex-wrap gap-2">
{thread.stack
.filter((tech: string) => tech !== 'Other')
.map((tech: string) => (
<Badge key={tech} variant="default">
{tech}
</Badge>
))}
</div>
</div>
)}
</div>
{/* CTA Button */}
<div>
<HelpOnPlatformButton
channel={thread.channel}
externalActivityUrl={thread.external_activity_url}
/>
</div>
</div>
</div>
)
}