import React, { useState, useEffect } from 'react';
import { Search, ShoppingCart, Heart, User, Menu, X, ChevronDown, ChevronRight, ArrowRight,
LogOut, Home, Package, Layers, Image, Settings, Users, BarChart2, PlusCircle, Edit,
Trash2, Eye, Save, Upload, Grid, List, FileText, MessageSquare, Calendar, DollarSign } from 'lucide-react';
export default function MibosWebsiteWithAdmin() {
// State for admin panel
const [isLoggedIn, setIsLoggedIn] = useState(false);
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [loginError, setLoginError] = useState('');
const [currentAdminPage, setCurrentAdminPage] = useState('dashboard');
const [showAdminPanel, setShowAdminPanel] = useState(false);
const [sidebarOpen, setSidebarOpen] = useState(true);
// State for category management
const [categories, setCategories] = useState([
{ id: 'assortment', name: 'Asortiman', subcategories: ['Women', 'Men', 'Kids', 'Accessories'] },
{ id: 'home', name: 'Početna', subcategories: ['Furniture', 'Decor', 'Kitchen', 'Textiles'] },
{ id: 'bobb', name: 'Bobb', subcategories: ['Smartphones', 'Computers', 'Audio', 'Accessories'] },
{ id: 'news', name: 'Novosti', subcategories: ['Smartphones', 'Computers', 'Audio', 'Accessories'] },
]);
const [editingCategory, setEditingCategory] = useState(null);
const [newCategory, setNewCategory] = useState({ name: '', id: '', subcategories: [] });
const [newSubcategory, setNewSubcategory] = useState('');
// State for product management
const [products, setProducts] = useState([
{ id: 1, name: 'Premium Wool Coat', category: 'assortment', subcategory: 'Women', brand: 'BOBB', price: '129,99 €', image: 'https://images.unsplash.com/photo-1591047139829-d91aecb6caea?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.8, featured: true, stock: 25 },
{ id: 2, name: 'Casual Linen Shirt', category: 'assortment', subcategory: 'Men', brand: 'BOBB', price: '49,99 €', image: 'https://images.unsplash.com/photo-1596755094514-f87e34085b2c?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.6, featured: false, stock: 42 },
{ id: 3, name: 'Modern Coffee Table', category: 'home', subcategory: 'Furniture', brand: 'Mibos Home', price: '199,99 €', image: 'https://images.unsplash.com/photo-1634712282287-14ed57b9cc89?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.9, featured: true, stock: 10 },
{ id: 4, name: 'Kids Denim Jacket', category: 'assortment', subcategory: 'Kids', brand: 'BOBB KIDS', price: '39,99 €', image: 'https://images.unsplash.com/photo-1519238263530-99bdd11df2ea?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.7, featured: false, stock: 18 },
]);
const [editingProduct, setEditingProduct] = useState(null);
const [newProduct, setNewProduct] = useState({
name: '', category: '', subcategory: '', brand: '',
price: '', image: '', rating: 5, featured: false, stock: 0
});
// State for content management
const [content, setContent] = useState([
{ id: 1, title: 'Summer Fashion Trends 2023', category: 'fashion', image: 'https://images.unsplash.com/photo-1469334031218-e382a71b716b?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', date: '2023-06-15', content: 'Discover the latest summer fashion trends for 2023...', featured: true },
{ id: 2, title: 'Home Decor Ideas for Small Spaces', category: 'home', image: 'https://images.unsplash.com/photo-1616486338812-3dadae4b4ace?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', date: '2023-05-28', content: 'Make the most of your small living space with these creative ideas...', featured: false },
{ id: 3, title: 'Back to School Essentials', category: 'bobb', image: 'https://images.unsplash.com/photo-1503676260728-1c00da094a0b?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', date: '2023-07-02', content: 'Get ready for the new school year with our essential picks...', featured: true },
{ id: 4, title: 'New BOBB Collection Launch', category: 'news', image: 'https://images.unsplash.com/photo-1558769132-cb1aea458c5e?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', date: '2023-07-15', content: 'Explore our latest BOBB collection featuring premium designs...', featured: true },
]);
const [editingContent, setEditingContent] = useState(null);
const [newContent, setNewContent] = useState({
title: '', category: '', image: '', date: '', content: '', featured: false
});
// State for gallery management
const [gallery, setGallery] = useState([
{ id: 1, title: 'Summer Collection', category: 'fashion', image: 'https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', featured: true },
{ id: 2, title: 'Modern Living Room', category: 'home', image: 'https://images.unsplash.com/photo-1583847268964-b28dc8f51f92?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', featured: false },
{ id: 3, title: 'BOBB Tech Gadgets', category: 'bobb', image: 'https://images.unsplash.com/photo-1468495244123-6c6c332eeece?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', featured: true },
{ id: 4, title: 'Store Opening Event', category: 'news', image: 'https://images.unsplash.com/photo-1511795409834-ef04bbd61622?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', featured: false },
]);
const [editingGallery, setEditingGallery] = useState(null);
const [newGallery, setNewGallery] = useState({
title: '', category: '', image: '', featured: false
});
// State for main website
const [isMenuOpen, setIsMenuOpen] = useState(false);
const [isSearchOpen, setIsSearchOpen] = useState(false);
const [isCartOpen, setIsCartOpen] = useState(false);
const [activeCategory, setActiveCategory] = useState(null);
const [scrolled, setScrolled] = useState(false);
const [cartItems, setCartItems] = useState([]);
const [wishlistCount, setWishlistCount] = useState(0);
// Handle scroll effect for sticky header
useEffect(() => {
const handleScroll = () => {
setScrolled(window.scrollY > 80);
};
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
}, []);
// Sample testimonials
const testimonials = [
{ id: 1, name: 'Ana Kovačić', image: 'https://randomuser.me/api/portraits/women/44.jpg', text: 'Mibos has been my go-to store for years. The quality of their products is consistently excellent, and the prices are always reasonable.' },
{ id: 2, name: 'Marko Horvat', image: 'https://randomuser.me/api/portraits/men/32.jpg', text: 'I recently furnished my entire apartment with items from Mibos Home collection. The quality is outstanding, and the designs are modern yet timeless.' },
{ id: 3, name: 'Ivana Novak', image: 'https://randomuser.me/api/portraits/women/68.jpg', text: 'BOBB KIDS clothing has been perfect for my children. Durable, stylish, and affordable - everything a parent could ask for!' },
];
// Sample store locations
const storeLocations = [
{ id: 1, name: 'Mibos City Center', address: 'Trg bana Josipa Jelačića 10, Zagreb', hours: 'Mon-Sat: 9:00-21:00, Sun: 10:00-18:00' },
{ id: 2, name: 'Mibos Mall of Split', address: 'Vukovarska 207, Split', hours: 'Mon-Sun: 9:00-22:00' },
{ id: 3, name: 'Mibos Rijeka', address: 'Riva 15, Rijeka', hours: 'Mon-Sat: 9:00-20:00, Sun: 10:00-18:00' },
];
// Website functions
const toggleMenu = () => setIsMenuOpen(!isMenuOpen);
const toggleSearch = () => setIsSearchOpen(!isSearchOpen);
const toggleCart = () => setIsCartOpen(!isCartOpen);
const addToCart = (product) => {
setCartItems([...cartItems, product]);
// Show a brief notification
const notification = document.getElementById('notification');
notification.classList.remove('opacity-0');
notification.classList.add('opacity-100');
setTimeout(() => {
notification.classList.remove('opacity-100');
notification.classList.add('opacity-0');
}, 2000);
};
const addToWishlist = () => {
setWishlistCount(wishlistCount + 1);
// Show a brief notification
const notification = document.getElementById('wishlist-notification');
notification.classList.remove('opacity-0');
notification.classList.add('opacity-100');
setTimeout(() => {
notification.classList.remove('opacity-100');
notification.classList.add('opacity-0');
}, 2000);
};
// Admin panel functions
const handleLogin = (e) => {
e.preventDefault();
if (username === 'admin' && password === 'password') {
setIsLoggedIn(true);
setLoginError('');
setShowAdminPanel(true);
} else {
setLoginError('Invalid username or password');
}
};
const handleLogout = () => {
setIsLoggedIn(false);
setShowAdminPanel(false);
setUsername('');
setPassword('');
};
const toggleSidebar = () => {
setSidebarOpen(!sidebarOpen);
};
// Category management functions
const handleAddCategory = () => {
if (newCategory.name && newCategory.id) {
setCategories([...categories, { ...newCategory, subcategories: newCategory.subcategories || [] }]);
setNewCategory({ name: '', id: '', subcategories: [] });
}
};
const handleEditCategory = (category) => {
setEditingCategory(category);
};
const handleUpdateCategory = () => {
if (editingCategory) {
setCategories(categories.map(cat => cat.id === editingCategory.id ? editingCategory : cat));
setEditingCategory(null);
}
};
const handleDeleteCategory = (categoryId) => {
setCategories(categories.filter(cat => cat.id !== categoryId));
};
const handleAddSubcategory = () => {
if (newSubcategory && editingCategory) {
const updatedCategory = {
...editingCategory,
subcategories: [...editingCategory.subcategories, newSubcategory]
};
setEditingCategory(updatedCategory);
setNewSubcategory('');
}
};
const handleRemoveSubcategory = (subcategory) => {
if (editingCategory) {
const updatedCategory = {
...editingCategory,
subcategories: editingCategory.subcategories.filter(sub => sub !== subcategory)
};
setEditingCategory(updatedCategory);
}
};
// Product management functions
const handleAddProduct = () => {
if (newProduct.name && newProduct.category) {
const productId = products.length > 0 ? Math.max(...products.map(p => p.id)) + 1 : 1;
setProducts([...products, { ...newProduct, id: productId }]);
setNewProduct({
name: '', category: '', subcategory: '', brand: '',
price: '', image: '', rating: 5, featured: false, stock: 0
});
}
};
const handleEditProduct = (product) => {
setEditingProduct(product);
};
const handleUpdateProduct = () => {
if (editingProduct) {
setProducts(products.map(prod => prod.id === editingProduct.id ? editingProduct : prod));
setEditingProduct(null);
}
};
const handleDeleteProduct = (productId) => {
setProducts(products.filter(prod => prod.id !== productId));
};
// Content management functions
const handleAddContent = () => {
if (newContent.title && newContent.category) {
const contentId = content.length > 0 ? Math.max(...content.map(c => c.id)) + 1 : 1;
setContent([...content, { ...newContent, id: contentId }]);
setNewContent({
title: '', category: '', image: '', date: '', content: '', featured: false
});
}
};
const handleEditContent = (contentItem) => {
setEditingContent(contentItem);
};
const handleUpdateContent = () => {
if (editingContent) {
setContent(content.map(item => item.id === editingContent.id ? editingContent : item));
setEditingContent(null);
}
};
const handleDeleteContent = (contentId) => {
setContent(content.filter(item => item.id !== contentId));
};
// Gallery management functions
const handleAddGallery = () => {
if (newGallery.title && newGallery.category) {
const galleryId = gallery.length > 0 ? Math.max(...gallery.map(g => g.id)) + 1 : 1;
setGallery([...gallery, { ...newGallery, id: galleryId }]);
setNewGallery({
title: '', category: '', image: '', featured: false
});
}
};
const handleEditGallery = (galleryItem) => {
setEditingGallery(galleryItem);
};
const handleUpdateGallery = () => {
if (editingGallery) {
setGallery(gallery.map(item => item.id === editingGallery.id ? editingGallery : item));
setEditingGallery(null);
}
};
const handleDeleteGallery = (galleryId) => {
setGallery(gallery.filter(item => item.id !== galleryId));
};
// Render admin panel
const renderAdminPanel = () => {
if (!isLoggedIn) {
return (
M ibos Admin
Sign in to manage your website
{loginError && (
{loginError}
)}
);
}
return (
{/* Sidebar */}
{sidebarOpen ? (
M ibos Admin
) : (
M
)}
{sidebarOpen ? : }
setCurrentAdminPage('dashboard')}
className={`flex items-center w-full px-4 py-3 ${currentAdminPage === 'dashboard' ? 'bg-[#2D3748] text-white' : 'text-gray-300 hover:bg-[#2D3748] hover:text-white'} transition-colors`}
>
{sidebarOpen && Dashboard }
setCurrentAdminPage('categories')}
className={`flex items-center w-full px-4 py-3 ${currentAdminPage === 'categories' ? 'bg-[#2D3748] text-white' : 'text-gray-300 hover:bg-[#2D3748] hover:text-white'} transition-colors`}
>
{sidebarOpen && Categories }
setCurrentAdminPage('products')}
className={`flex items-center w-full px-4 py-3 ${currentAdminPage === 'products' ? 'bg-[#2D3748] text-white' : 'text-gray-300 hover:bg-[#2D3748] hover:text-white'} transition-colors`}
>
{sidebarOpen && Products }
setCurrentAdminPage('content')}
className={`flex items-center w-full px-4 py-3 ${currentAdminPage === 'content' ? 'bg-[#2D3748] text-white' : 'text-gray-300 hover:bg-[#2D3748] hover:text-white'} transition-colors`}
>
{sidebarOpen && Content }
setCurrentAdminPage('gallery')}
className={`flex items-center w-full px-4 py-3 ${currentAdminPage === 'gallery' ? 'bg-[#2D3748] text-white' : 'text-gray-300 hover:bg-[#2D3748] hover:text-white'} transition-colors`}
>
{sidebarOpen && Gallery }
setCurrentAdminPage('users')}
className={`flex items-center w-full px-4 py-3 ${currentAdminPage === 'users' ? 'bg-[#2D3748] text-white' : 'text-gray-300 hover:bg-[#2D3748] hover:text-white'} transition-colors`}
>
{sidebarOpen && Users }
setCurrentAdminPage('settings')}
className={`flex items-center w-full px-4 py-3 ${currentAdminPage === 'settings' ? 'bg-[#2D3748] text-white' : 'text-gray-300 hover:bg-[#2D3748] hover:text-white'} transition-colors`}
>
{sidebarOpen && Settings }
{sidebarOpen && Logout }
{/* Main Content */}
{currentAdminPage.charAt(0).toUpperCase() + currentAdminPage.slice(1)}
setShowAdminPanel(false)}
className="flex items-center text-gray-600 hover:text-[#457B9D] transition-colors"
>
View Website
Admin User
{currentAdminPage === 'dashboard' && (
Total Products
{products.length}
Sales Overview
Sales chart would be displayed here
Recent Activity
New product added: Premium Wool Coat
2 hours ago
New order: #12345
3 hours ago
New customer: Marko Horvat
5 hours ago
New message from: Ana Kovačić
6 hours ago
{products.slice(0, 3).map((product) => (
{product.name}
{product.brand}
))}
{[
{ id: '12345', customer: 'Ana Kovačić', date: '2023-07-20', status: 'Delivered', total: '€179.98' },
{ id: '12344', customer: 'Marko Horvat', date: '2023-07-19', status: 'Processing', total: '€249.99' },
{ id: '12343', customer: 'Ivana Novak', date: '2023-07-18', status: 'Shipped', total: '€89.97' },
].map((order) => (
Order #{order.id}
{order.customer}
{order.total}
{order.status}
))}
)}
{currentAdminPage === 'categories' && (
Add New Category
Add Category
Manage Categories
ID
Name
Subcategories
Actions
{categories.map((category) => (
{category.id}
{category.name}
{category.subcategories.join(', ')}
handleEditCategory(category)}
className="text-[#457B9D] hover:text-[#3D6E8C] mr-3"
>
handleDeleteCategory(category.id)}
className="text-red-500 hover:text-red-700"
>
))}
{editingCategory && (
Edit Category: {editingCategory.name}
Subcategories
{editingCategory.subcategories.map((subcategory, index) => (
{subcategory}
handleRemoveSubcategory(subcategory)}
className="ml-2 text-gray-500 hover:text-red-500"
>
))}
setNewSubcategory(e.target.value)}
className="flex-grow px-4 py-2 border border-gray-300 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
placeholder="Add new subcategory"
/>
Add
Update Category
setEditingCategory(null)}
className="px-4 py-2 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 transition-colors"
>
Cancel
)}
)}
{currentAdminPage === 'products' && (
Add New Product
Product Name
setNewProduct({ ...newProduct, name: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
placeholder="e.g. Premium Wool Coat"
/>
Category
setNewProduct({ ...newProduct, category: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
>
Select Category
{categories.map((category) => (
{category.name}
))}
Subcategory
setNewProduct({ ...newProduct, subcategory: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
>
Select Subcategory
{categories.find(cat => cat.id === newProduct.category)?.subcategories.map((subcat, index) => (
{subcat}
))}
Brand
setNewProduct({ ...newProduct, brand: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
placeholder="e.g. BOBB"
/>
Price
setNewProduct({ ...newProduct, price: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
placeholder="e.g. 129,99 €"
/>
Stock
setNewProduct({ ...newProduct, stock: parseInt(e.target.value) })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
placeholder="e.g. 25"
/>
Image URL
setNewProduct({ ...newProduct, image: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
placeholder="Enter image URL"
/>
Rating
setNewProduct({ ...newProduct, rating: parseFloat(e.target.value) })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
/>
setNewProduct({ ...newProduct, featured: e.target.checked })}
className="h-4 w-4 text-[#457B9D] focus:ring-[#457B9D] border-gray-300 rounded"
/>
Featured Product
Add Product
Product
Category
Price
Stock
Featured
Actions
{products.map((product) => (
{product.name}
{product.brand}
{categories.find(cat => cat.id === product.category)?.name || product.category}
{product.subcategory}
{product.price}
{product.stock}
{product.featured ? (
Yes
) : (
No
)}
handleEditProduct(product)}
className="text-[#457B9D] hover:text-[#3D6E8C] mr-3"
>
handleDeleteProduct(product.id)}
className="text-red-500 hover:text-red-700"
>
))}
{editingProduct && (
Edit Product: {editingProduct.name}
Product Name
setEditingProduct({ ...editingProduct, name: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
/>
Category
setEditingProduct({ ...editingProduct, category: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
>
{categories.map((category) => (
{category.name}
))}
Subcategory
setEditingProduct({ ...editingProduct, subcategory: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
>
{categories.find(cat => cat.id === editingProduct.category)?.subcategories.map((subcat, index) => (
{subcat}
))}
Brand
setEditingProduct({ ...editingProduct, brand: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
/>
Price
setEditingProduct({ ...editingProduct, price: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
/>
Stock
setEditingProduct({ ...editingProduct, stock: parseInt(e.target.value) })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
/>
Image URL
setEditingProduct({ ...editingProduct, image: e.target.value })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
/>
Rating
setEditingProduct({ ...editingProduct, rating: parseFloat(e.target.value) })}
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#457B9D]"
/>
setEditingProduct({ ...editingProduct, featured: e.target.checked })}
className="h-4 w-4 text-[#457B9D] focus:ring-[#457B9D] border-gray-300 rounded"
/>
Featured Product
Update Product
setEditingProduct(null)}
className="px-4 py-2 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 transition-colors"
>
Cancel
)}
)}
{currentAdminPage === 'content' && (
Add New Content
Add Content
Manage Content
All Categories
Fashion
Home
Bobb
News
Title
Category
Date
Featured
Actions
{content.map((item) => (
{item.title}
{item.category.charAt(0).toUpperCase() + item.category.slice(1)}
{item.date}
{item.featured ? (
Yes
) : (
No
)}
handleEditContent(item)}
className="text-[#457B9D] hover:text-[#3D6E8C] mr-3"
>
handleDeleteContent(item.id)}
className="text-red-500 hover:text-red-700"
>
))}
{editingContent && (
Edit Content: {editingContent.title}
Update Content
setEditingContent(null)}
className="px-4 py-2 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 transition-colors"
>
Cancel
)}
)}
{currentAdminPage === 'gallery' && (
Add New Gallery Item
Add to Gallery
Manage Gallery
All Categories
Fashion
Home
Bobb
News
{gallery.map((item) => (
{item.featured && (
Featured
)}
{item.title}
{item.category.charAt(0).toUpperCase() + item.category.slice(1)}
handleEditGallery(item)}
className="p-1 text-[#457B9D] hover:text-[#3D6E8C]"
>
handleDeleteGallery(item.id)}
className="p-1 text-red-500 hover:text-red-700"
>
))}
{editingGallery && (
Edit Gallery Item: {editingGallery.title}
Update Gallery Item
setEditingGallery(null)}
className="px-4 py-2 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 transition-colors"
>
Cancel
)}
)}
{currentAdminPage === 'users' && (
Manage Users
User
Email
Role
Status
Actions
{[
{ id: 1, name: 'Admin User', email: 'admin@mibos.com', role: 'Administrator', status: 'Active', avatar: 'https://randomuser.me/api/portraits/men/32.jpg' },
{ id: 2, name: 'Editor User', email: 'editor@mibos.com', role: 'Editor', status: 'Active', avatar: 'https://randomuser.me/api/portraits/women/44.jpg' },
{ id: 3, name: 'Viewer User', email: 'viewer@mibos.com', role: 'Viewer', status: 'Inactive', avatar: 'https://randomuser.me/api/portraits/men/68.jpg' },
].map((user) => (
{user.name}
{user.email}
{user.role}
{user.status === 'Active' ? (
Active
) : (
Inactive
)}
))}
)}
{currentAdminPage === 'settings' && (
General Settings
Save Settings
Social Media
Save Social Media
SEO Settings
Save SEO Settings
)}
);
};
// Render main website
const renderWebsite = () => {
return (
{/* Notification */}
Product added to cart!
Product added to wishlist!
{/* Header */}
{/* Mobile menu button */}
{isMenuOpen ? : }
{/* Logo */}
{/* Desktop Navigation */}
{categories.map((category) => (
setActiveCategory(category.id)}
onMouseLeave={() => setActiveCategory(null)}>
{category.name}
{/* Mega Menu */}
{category.name} Categories
{category.subcategories.map((subcat, idx) => (
{subcat}
))}
Featured
New Arrivals
Discover the latest in {category.name.toLowerCase()}
Shop Now
))}
Sale
About Us
{/* Header Icons */}
addToWishlist()}>
{wishlistCount > 0 && (
{wishlistCount}
)}
{cartItems.length > 0 && (
{cartItems.length}
)}
setShowAdminPanel(true)}
>
{/* Mobile Menu */}
{categories.map((category) => (
setActiveCategory(activeCategory === category.id ? null : category.id)}>
{category.name}
{activeCategory === category.id && (
{category.subcategories.map((subcat, idx) => (
{subcat}
))}
)}
))}
Sale
About Us
{
setShowAdminPanel(true);
setIsMenuOpen(false);
}}
>
Admin Panel
{/* Search Overlay */}
{/* Cart Sidebar */}
Your Cart ({cartItems.length})
{cartItems.length === 0 ? (
Your cart is empty
Continue Shopping
) : (
{cartItems.map((item, index) => (
))}
)}
{cartItems.length > 0 && (
Subtotal
219,97 €
Proceed to Checkout
)}
{/* Main Content */}
{/* Hero Section */}
Elevate Your Lifestyle
Discover premium quality at affordable prices. From fashion to home decor, find everything you need at Mibos.
{/* Category Cards */}
Shop by Category
{[
{ name: 'Women', image: 'https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
{ name: 'Men', image: 'https://images.unsplash.com/photo-1617137968427-85924c800a22?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
{ name: 'Home', image: 'https://images.unsplash.com/photo-1616486338812-3dadae4b4ace?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
{ name: 'Kids', image: 'https://images.unsplash.com/photo-1622290291468-a28f7a7dc6a8?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
].map((category, index) => (
))}
{/* Featured Products */}
{products.filter(p => p.featured).map((product) => (
addToCart(product)}
>
addToWishlist()}
>
{[...Array(5)].map((_, i) => (
))}
{product.rating}
{product.name}
{product.brand}
{product.price}
))}
{/* Brand Story Banner */}
Our Story
For over 23 years, Mibos Robna Kuća has been a trusted destination for quality products at affordable prices. What started as a small family business has grown into one of the region's most beloved retailers.
Our commitment to excellence and customer satisfaction remains at the heart of everything we do. From our BOBB fashion line to our extensive home collection, we strive to bring you the best products at prices that make sense.
Learn More About Us
{/* Testimonials */}
What Our Customers Say
{testimonials.map((testimonial) => (
{testimonial.name}
{[...Array(5)].map((_, i) => (
))}
{testimonial.text}
))}
{/* Blog/News Section */}
import React, { useState, useEffect } from 'react';
import { Search, ShoppingCart, Heart, User, Menu, X, ChevronDown, ChevronRight, MapPin, Star, ArrowRight, Instagram, Facebook, Twitter } from 'lucide-react';
export default function MibosWebsite() {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const [isSearchOpen, setIsSearchOpen] = useState(false);
const [isCartOpen, setIsCartOpen] = useState(false);
const [activeCategory, setActiveCategory] = useState(null);
const [scrolled, setScrolled] = useState(false);
const [cartItems, setCartItems] = useState([]);
const [wishlistCount, setWishlistCount] = useState(0);
// Handle scroll effect for sticky header
useEffect(() => {
const handleScroll = () => {
setScrolled(window.scrollY > 80);
};
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
}, []);
// Sample product data
const featuredProducts = [
{ id: 1, name: 'Premium Wool Coat', brand: 'BOBB', price: '129,99 €', image: 'https://images.unsplash.com/photo-1591047139829-d91aecb6caea?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.8 },
{ id: 2, name: 'Casual Linen Shirt', brand: 'BOBB', price: '49,99 €', image: 'https://images.unsplash.com/photo-1596755094514-f87e34085b2c?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.6 },
{ id: 3, name: 'Modern Coffee Table', brand: 'Mibos Home', price: '199,99 €', image: 'https://images.unsplash.com/photo-1634712282287-14ed57b9cc89?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.9 },
{ id: 4, name: 'Kids Denim Jacket', brand: 'BOBB KIDS', price: '39,99 €', image: 'https://images.unsplash.com/photo-1519238263530-99bdd11df2ea?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', rating: 4.7 },
];
// Sample categories
const categories = [
{ id: 'fashion', name: 'Fashion', subcategories: ['Women', 'Men', 'Kids', 'Accessories'] },
{ id: 'home', name: 'Home', subcategories: ['Furniture', 'Decor', 'Kitchen', 'Textiles'] },
{ id: 'beauty', name: 'Beauty', subcategories: ['Skincare', 'Makeup', 'Fragrance', 'Bath & Body'] },
{ id: 'electronics', name: 'Electronics', subcategories: ['Smartphones', 'Computers', 'Audio', 'Accessories'] },
];
// Sample testimonials
const testimonials = [
{ id: 1, name: 'Ana Kovačić', image: 'https://randomuser.me/api/portraits/women/44.jpg', text: 'Mibos has been my go-to store for years. The quality of their products is consistently excellent, and the prices are always reasonable.' },
{ id: 2, name: 'Marko Horvat', image: 'https://randomuser.me/api/portraits/men/32.jpg', text: 'I recently furnished my entire apartment with items from Mibos Home collection. The quality is outstanding, and the designs are modern yet timeless.' },
{ id: 3, name: 'Ivana Novak', image: 'https://randomuser.me/api/portraits/women/68.jpg', text: 'BOBB KIDS clothing has been perfect for my children. Durable, stylish, and affordable - everything a parent could ask for!' },
];
// Sample blog posts
const blogPosts = [
{ id: 1, title: 'Summer Fashion Trends 2023', image: 'https://images.unsplash.com/photo-1469334031218-e382a71b716b?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', date: 'June 15, 2023' },
{ id: 2, title: 'Home Decor Ideas for Small Spaces', image: 'https://images.unsplash.com/photo-1616486338812-3dadae4b4ace?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', date: 'May 28, 2023' },
{ id: 3, title: 'Back to School Essentials', image: 'https://images.unsplash.com/photo-1503676260728-1c00da094a0b?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', date: 'July 2, 2023' },
];
// Sample store locations
const storeLocations = [
{ id: 1, name: 'Mibos City Center', address: 'Trg bana Josipa Jelačića 10, Zagreb', hours: 'Mon-Sat: 9:00-21:00, Sun: 10:00-18:00' },
{ id: 2, name: 'Mibos Mall of Split', address: 'Vukovarska 207, Split', hours: 'Mon-Sun: 9:00-22:00' },
{ id: 3, name: 'Mibos Rijeka', address: 'Riva 15, Rijeka', hours: 'Mon-Sat: 9:00-20:00, Sun: 10:00-18:00' },
];
const toggleMenu = () => setIsMenuOpen(!isMenuOpen);
const toggleSearch = () => setIsSearchOpen(!isSearchOpen);
const toggleCart = () => setIsCartOpen(!isCartOpen);
const addToCart = (product) => {
setCartItems([...cartItems, product]);
// Show a brief notification
const notification = document.getElementById('notification');
notification.classList.remove('opacity-0');
notification.classList.add('opacity-100');
setTimeout(() => {
notification.classList.remove('opacity-100');
notification.classList.add('opacity-0');
}, 2000);
};
const addToWishlist = () => {
setWishlistCount(wishlistCount + 1);
// Show a brief notification
const notification = document.getElementById('wishlist-notification');
notification.classList.remove('opacity-0');
notification.classList.add('opacity-100');
setTimeout(() => {
notification.classList.remove('opacity-100');
notification.classList.add('opacity-0');
}, 2000);
};
return (
{/* Notification */}
Product added to cart!
Product added to wishlist!
{/* Header */}
{/* Mobile menu button */}
{isMenuOpen ? : }
{/* Logo */}
{/* Desktop Navigation */}
{categories.map((category) => (
setActiveCategory(category.id)}
onMouseLeave={() => setActiveCategory(null)}>
{category.name}
{/* Mega Menu */}
{category.name} Categories
{category.subcategories.map((subcat, idx) => (
{subcat}
))}
Featured
New Arrivals
Discover the latest in {category.name.toLowerCase()}
Shop Now
))}
Sale
About Us
{/* Header Icons */}
addToWishlist()}>
{wishlistCount > 0 && (
{wishlistCount}
)}
{cartItems.length > 0 && (
{cartItems.length}
)}
{/* Mobile Menu */}
{categories.map((category) => (
setActiveCategory(activeCategory === category.id ? null : category.id)}>
{category.name}
{activeCategory === category.id && (
{category.subcategories.map((subcat, idx) => (
{subcat}
))}
)}
))}
Sale
About Us
{/* Search Overlay */}
{/* Cart Sidebar */}
Your Cart ({cartItems.length})
{cartItems.length === 0 ? (
Your cart is empty
Continue Shopping
) : (
{cartItems.map((item, index) => (
))}
)}
{cartItems.length > 0 && (
Subtotal
219,97 €
Proceed to Checkout
)}
{/* Main Content */}
{/* Hero Section */}
Elevate Your Lifestyle
Discover premium quality at affordable prices. From fashion to home decor, find everything you need at Mibos.
{/* Category Cards */}
Shop by Category
{[
{ name: 'Women', image: 'https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
{ name: 'Men', image: 'https://images.unsplash.com/photo-1617137968427-85924c800a22?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
{ name: 'Home', image: 'https://images.unsplash.com/photo-1616486338812-3dadae4b4ace?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
{ name: 'Kids', image: 'https://images.unsplash.com/photo-1622290291468-a28f7a7dc6a8?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80' },
].map((category, index) => (
))}
{/* Featured Products */}
{featuredProducts.map((product) => (
addToCart(product)}
>
addToWishlist()}
>
{[...Array(5)].map((_, i) => (
))}
{product.rating}
{product.name}
{product.brand}
{product.price}
))}
{/* Brand Story Banner */}
Our Story
For over 23 years, Mibos Robna Kuća has been a trusted destination for quality products at affordable prices. What started as a small family business has grown into one of the region's most beloved retailers.
Our commitment to excellence and customer satisfaction remains at the heart of everything we do. From our BOBB fashion line to our extensive home collection, we strive to bring you the best products at prices that make sense.
Learn More About Us
{/* Testimonials */}
What Our Customers Say
{testimonials.map((testimonial) => (
{testimonial.name}
{[...Array(5)].map((_, i) => (
))}
{testimonial.text}
))}
{/* Blog/News Section */}
{blogPosts.map((post) => (
))}
{/* Store Locator */}
Find a Store Near You
Interactive map would be displayed here
{storeLocations.map((location) => (
{location.name}
{location.address}
{location.hours}
))}
{/* Newsletter */}
Stay Updated
Subscribe to our newsletter and be the first to know about new arrivals, exclusive offers, and seasonal sales.
{/* Footer */}
Mibos
Excellent quality, affordable prices. Your trusted retailer for over 23 years.
© 2023 Mibos Robna Kuća. All rights reserved.
);
}