mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 19:35:06 +03:00
## 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
49 lines
1.2 KiB
TypeScript
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"
|
|
/>
|
|
)
|
|
}
|
|
}
|