mirror of
https://github.com/penxio/penx.git
synced 2026-01-13 15:38:12 -05:00
12 lines
329 B
TypeScript
12 lines
329 B
TypeScript
import { RouterOutputs } from '@/server/_app'
|
|
import { atom, useAtom } from 'jotai'
|
|
|
|
export type Channel = RouterOutputs['channel']['listBySpaceId']['0']
|
|
|
|
export const channelsAtom = atom<Channel[]>([])
|
|
|
|
export function useChannels() {
|
|
const [channels, setChannels] = useAtom(channelsAtom)
|
|
return { channels, setChannels }
|
|
}
|