Integrate FavoriteProperty API: add/remove/get favorites with real backend
All checks were successful
Build frontend / build (push) Successful in 42s

This commit is contained in:
Claw AI
2026-03-30 17:54:42 +00:00
parent 1f40c6a4fd
commit 3b9831a513
5 changed files with 152 additions and 33 deletions

View File

@ -11,8 +11,7 @@ import AuthService from '@/app/services/AuthService';
export default function FavoritesPage() {
const router = useRouter();
const { favorites, removeFavorite } = useFavorites();
const [isLoading, setIsLoading] = useState(true);
const { favorites, isLoading: favoritesLoading, removeFavorite } = useFavorites();
const [isAdmin, setIsAdmin] = useState(false);
useEffect(() => {
@ -21,14 +20,13 @@ export default function FavoritesPage() {
return;
}
setIsAdmin(AuthService.isAdmin());
setIsLoading(false);
}, [router]);
const formatCurrency = (amount) => {
return amount?.toLocaleString() + ' ل.س';
};
if (isLoading) {
if (favoritesLoading) {
return (
<div className="min-h-screen flex items-center justify-center">
<div className="text-center">