'use client' import { AiUserBaseOutput } from '@/services/user' import { createContext } from 'react' import { useGetAIUserBaseInfo } from '@/hooks/aiUser' import { useParams } from 'next/navigation' import { useCurrentUser } from '@/hooks/auth' import Empty from '@/components/ui/empty' export * from './useAIUser' const AIUserContext = createContext<{ user: AiUserBaseOutput | undefined isOwner: boolean userId: number | undefined }>({ user: undefined, isOwner: false, userId: undefined, }) export const AIUserProvider = ({ children }: { children: React.ReactNode }) => { const { userId } = useParams() const { data, error } = useGetAIUserBaseInfo({ aiId: Number(userId) }) const { data: currentUser } = useCurrentUser() const isOwner = currentUser?.userId === data?.userId if (error) { return (