mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 05:09:12 +03:00
* fix toast examples * add sonner stuff * new sonner examples added * updated * add upload POC * add * Update sonner-upload.tsx * move statusicons * Minor fix. --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
30 lines
799 B
TypeScript
30 lines
799 B
TypeScript
import { Style } from '@/registry/styles'
|
|
import { Theme } from '@/registry/themes'
|
|
import { useAtom } from 'jotai'
|
|
import { atomWithStorage } from 'jotai/utils'
|
|
import { ComponentProps } from 'react'
|
|
import { SonnerToaster } from 'ui'
|
|
// import { BackendProvider } from '@/registry/backend-provider'
|
|
|
|
type Config = {
|
|
style: Style['name']
|
|
theme: Theme['name']
|
|
radius: number
|
|
sonnerPosition: ComponentProps<typeof SonnerToaster>['position']
|
|
sonnerExpand: boolean
|
|
// backendProvider: BackendProvider['name'] | undefined
|
|
}
|
|
|
|
const configAtom = atomWithStorage<Config>('config', {
|
|
style: 'default',
|
|
theme: 'zinc',
|
|
radius: 0.5,
|
|
sonnerPosition: 'bottom-right',
|
|
sonnerExpand: false,
|
|
// backendProvider: 'nextjs-auth',
|
|
})
|
|
|
|
export function useConfig() {
|
|
return useAtom(configAtom)
|
|
}
|