feat: convert to nextjs

This commit is contained in:
2024-12-07 07:45:24 +01:00
parent b248ee80ee
commit 633b8ee207
52 changed files with 4121 additions and 982 deletions

View File

@@ -0,0 +1,23 @@
import { createContext, useContext } from 'react';
export interface Toast {
id: number;
message: string;
}
interface ToastContextType {
showToast: (message: string) => void;
toasts: Toast[];
}
export const ToastContext = createContext<ToastContextType | undefined>(
undefined
);
export const useToast = () => {
const context = useContext(ToastContext);
if (!context) {
throw new Error('useToast must be used within a ToastProvider');
}
return context;
};