const fetchItems = async () => {
try {
setIsLoading(true);
const queryParams = new URLSearchParams({
queryItem: queryItem,
auction_item_category: queryCategory,
minPrice: String(minPrice),
maxPrice: String(maxPrice),
});
const response = await fetch(`/api/items?${queryParams.toString()}`);
if (!response.ok) throw new Error(`Failed to fetch items: ${response.statusText}`);
const auctionItems = await response.json();
setItems(auctionItems);
setIsLoading(false);
} catch (error) {
console.error('Failed to fetch items:', error);
setIsLoading(false);
}
};
{/* Sidebar PC */}
<div className="col-span-1 row-span-4 hidden rounded-md md:block">
{/* ... */}
</div>
{/* Sidebar Mobile */}
<div className="col-span-4 row-span-1 block rounded-md md:hidden">
{/* ... */}
</div>