mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
This PR moves several components which rely on `next` out of the `ui` package to the `ui-patterns` package. `ui-patterns` package is intented to be imported with specific imports so it's ok if there are components reliant on `next` in there. The `SonnerToaster` component has removed its dependency by requiring a prop for `theme`.
19 lines
395 B
TypeScript
19 lines
395 B
TypeScript
'use client'
|
|
|
|
import { useTheme } from 'next-themes'
|
|
import { SonnerToaster } from 'ui'
|
|
|
|
import { useConfig } from '@/hooks/use-config'
|
|
|
|
export function Toaster() {
|
|
const [config] = useConfig()
|
|
const { theme } = useTheme()
|
|
return (
|
|
<SonnerToaster
|
|
position={config.sonnerPosition}
|
|
expand={config.sonnerExpand}
|
|
theme={theme as 'light' | 'dark' | 'system'}
|
|
/>
|
|
)
|
|
}
|