Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

579 B
Raw Blame
'use client';

import { type ReactNode } from 'react';
import { createContext, memo, use } from 'react';

import { type DiscoverModelDetail } from '@/types/discover';

export type DetailContextConfig = Partial<DiscoverModelDetail>;

export const DetailContext = createContext<DetailContextConfig>({});

export const DetailProvider = memo<{ children: ReactNode; config?: DetailContextConfig }>(
  ({ children, config = {} }) => {
    return <DetailContext value={config}>{children}</DetailContext>;
  },
);

export const useDetailContext = () => {
  return use(DetailContext);
};