mirror of
https://github.com/penxio/penx.git
synced 2026-04-19 03:03:06 -04:00
27 lines
736 B
TypeScript
27 lines
736 B
TypeScript
'use client'
|
|
|
|
import { useCreation, useQueryCreation } from '@/hooks/useCreation'
|
|
import { PostWithSpace } from '@/hooks/usePost'
|
|
import { RouterOutputs } from '@/server/_app'
|
|
import { BuyDialog } from './BuyDialog/BuyDialog'
|
|
import { SellDialog } from './SellDialog/SellDialog'
|
|
|
|
interface Props {
|
|
creationId: string
|
|
space: RouterOutputs['space']['byId']
|
|
post?: PostWithSpace
|
|
}
|
|
|
|
export function InitBuySellDialog({ post, space, creationId }: Props) {
|
|
const { creation } = useCreation()
|
|
const { isLoading, data } = useQueryCreation(creationId)
|
|
if (isLoading) return null
|
|
if (!creation) return null
|
|
return (
|
|
<>
|
|
<BuyDialog space={space} post={post} />
|
|
<SellDialog space={space} post={post} />
|
|
</>
|
|
)
|
|
}
|