Fix IDE errors from ESLint cleanup
This commit is contained in:
@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Heart, ShoppingCart, Trash2, X } from 'lucide-react';
|
||||
import { api } from '@/lib/api/client';
|
||||
import { useCartStore } from '@/lib/cart/store';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { formatPrice } from '@/lib/currency';
|
||||
import { toast } from 'sonner';
|
||||
@@ -26,15 +25,20 @@ interface WishlistItem {
|
||||
|
||||
export default function Wishlist() {
|
||||
const navigate = useNavigate();
|
||||
const { addItem } = useCartStore();
|
||||
const [items, setItems] = useState<WishlistItem[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const { isEnabled, isLoading: modulesLoading } = useModules();
|
||||
const { settings: wishlistSettings } = useModuleSettings('wishlist');
|
||||
|
||||
useEffect(() => {
|
||||
if (isEnabled('wishlist')) {
|
||||
loadWishlist();
|
||||
}
|
||||
}, [isEnabled]);
|
||||
|
||||
if (modulesLoading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center">
|
||||
<div className="flex items-center justify-center min-h-screen">
|
||||
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900"></div>
|
||||
</div>
|
||||
);
|
||||
@@ -57,10 +61,6 @@ export default function Wishlist() {
|
||||
);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
loadWishlist();
|
||||
}, []);
|
||||
|
||||
const loadWishlist = async () => {
|
||||
try {
|
||||
const data = await api.get<WishlistItem[]>('/account/wishlist');
|
||||
@@ -91,7 +91,7 @@ export default function Wishlist() {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await api.post('/cart/add', {
|
||||
await api.post('/cart/add', {
|
||||
product_id: item.product_id,
|
||||
quantity: 1,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user