Files
SAE-BUT2-frontend/src/contexts/Auth/AuthContext.ts
T

33 lines
617 B
TypeScript

import { createContext } from "react";
export interface Task {
id: number;
title?: string;
completed?: boolean;
[key: string]: unknown;
}
export interface User {
id: number
name: string;
lastname: string;
role: string;
email: string;
phone: string | null;
created_at: string;
profile_photo_path?: string | null;
tasks: Task[];
}
export interface AuthContextType {
user: User | null;
loading: boolean;
update: () => void;
login: (email: string, password: string) => Promise<{ status: number }>;
}
export const AuthContext = createContext<AuthContextType | null>(null);