Spaces:
Sleeping
Sleeping
File size: 993 Bytes
ea9ca44 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import React, { useEffect, useState } from 'react';
import { supabase } from '../../supabaseClient'; // ✅ Imported Supabase
import SettingsPage from '../../pages/settingsPage'; // 👈 Check this path!
export default function AdminProfile({ onNavigate }) {
const [loading, setLoading] = useState(true);
const [user, setUser] = useState(null);
useEffect(() => {
const checkUser = async () => {
const { data: { user } } = await supabase.auth.getUser();
setUser(user);
setLoading(false);
};
checkUser();
}, []);
if (loading) {
return <div style={{ color: 'white', padding: '2rem' }}>Loading Profile...</div>;
}
// Render the existing SettingsPage component
return (
<div style={{ height: '100%', width: '100%' }}>
{/* You can pass the user object down if SettingsPage needs it */}
<SettingsPage onNavigate={onNavigate} user={user} />
</div>
);
} |