Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

775 B
Raw Blame
import { createContext, FC, ReactNode, useContext } from 'react';
import { Post } from '@prisma/client';
const ExistingDataContext = createContext({
  integration: '',
  group: undefined as undefined | string,
  posts: [] as Post[],
  settings: {} as any,
  // the other channels the post was created with
  siblings: undefined as
    | undefined
    | {
        integration: string;
        group: string;
        posts: Post[];
        settings: any;
      }[],
});
export const ExistingDataContextProvider: FC<{
  children: ReactNode;
  value: any;
}> = ({ children, value }) => {
  return (
    <ExistingDataContext.Provider value={value}>
      {children}
    </ExistingDataContext.Provider>
  );
};
export const useExistingData = () => useContext(ExistingDataContext);