23 lines
509 B
TypeScript
23 lines
509 B
TypeScript
import { createContext } from "react";
|
|
|
|
export type Task = {
|
|
name: string;
|
|
description: string;
|
|
start: string | Date;
|
|
end: string | Date;
|
|
};
|
|
|
|
export type EventGroup = {
|
|
date: string;
|
|
name: string;
|
|
start: string | Date;
|
|
tasks: Task[];
|
|
};
|
|
|
|
export type EventContextType = {
|
|
events: EventGroup[];
|
|
updateEvent: () => void;
|
|
addEvent: (name: string, description: string, start: string, end: string) => Promise<void>;
|
|
};
|
|
|
|
export const EventContext = createContext<EventContextType | null>(null); |