Files
supabase/apps/www/components/Contribute/UnansweredThreads.tsx
Gildas Garcia b30db91d71 chore: cleanup UI patterns exports (#47406)
## Problem

We now export components under a subpath in ui-patterns to avoid barrel
files as they slow down every tools (from IDE to linters, etc.) and may
also affect bundles our users have to download.

## Solution

- Remove the UI patterns index file
- Fix invalid impors
2026-06-30 09:23:17 +02:00

49 lines
1.2 KiB
TypeScript

import { Admonition } from 'ui-patterns/admonition'
import {
getAllProductAreas,
getAllStacks,
getChannelCounts,
getUnansweredThreads,
} from '~/data/contribute'
import { UnansweredThreadsTable } from './UnansweredThreadsTable'
export async function UnansweredThreads({
product_area,
channel,
stack,
search,
}: {
product_area?: string | string[]
channel?: string
stack?: string | string[]
search?: string
}) {
try {
const [threads, channelCounts, allProductAreas, allStacks] = await Promise.all([
getUnansweredThreads(product_area, channel, stack, search),
getChannelCounts(product_area, stack, search),
getAllProductAreas(),
getAllStacks(),
])
return (
<UnansweredThreadsTable
threads={threads}
channelCounts={channelCounts}
allProductAreas={allProductAreas}
allStacks={allStacks}
/>
)
} catch (error) {
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
return (
<Admonition
type="destructive"
title="Error loading threads"
description={errorMessage}
className="max-w-md mx-auto"
/>
)
}
}