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 {
DatabaseViewFilterAttributes,
FieldAttributes,
FieldValue,
} from '@colanode/core';
interface RecordItem {
id: string;
name: string;
fields: Record<string, FieldValue>;
canEdit: boolean;
}
interface BoardViewContext {
field: FieldAttributes;
filter: DatabaseViewFilterAttributes;
canDrop: (record: RecordItem) => boolean;
drop: (record: RecordItem) => FieldValue | null;
dragOverClass?: string;
header: React.ReactNode;
canDrag: (record: RecordItem) => boolean;
onDragEnd: (item: RecordItem, value: FieldValue | null) => void;
}
export const BoardViewContext = createContext<BoardViewContext>(
{} as BoardViewContext
);
export const useBoardView = () => useContext(BoardViewContext);