// AppContext.js
import React, { createContext, useContext, useState } from 'react';

// Membuat Context
const AppContext = createContext({});

// Hook untuk menggunakan Context
export const useAppContext = () => useContext(AppContext);

// Provider untuk membungkus aplikasi
export const AppProvider = ({ children }: any) => {
    const [data, setData] = useState(null);

    const loadData = () => {
        console.log('Data sedang di-load...');
    };

    return (
        <AppContext.Provider value={{ data, loadData }}>
            {children}
        </AppContext.Provider>
    );
};
