Open-source and local-first Slack and Notion alternative that puts you in control of your data
TypeScript chatchat-applicationcrdteditorelectronknowledge-baselocal-firstnotionnotion-alternativerealtime-collaborationself-hostedslacksqliteteam-collaborationwikiyjs
import { createContext, useContext } from 'react';
import { LocalFileNode } from '@colanode/client/types';
interface FolderContext {
id: string;
name: string;
files: LocalFileNode[];
onClick: (event: React.MouseEvent<HTMLElement>, id: string) => void;
onDoubleClick: (event: React.MouseEvent<HTMLElement>, id: string) => void;
onMove: (nodeId: string, targetId: string) => void;
}
export const FolderContext = createContext<FolderContext>({} as FolderContext);
export const useFolder = () => useContext(FolderContext);