feat: Add coupon edit route and multiselect component
Fixed blank coupon edit page and added multiselect component 1. Fixed Missing Route: - Added CouponEdit import in App.tsx - Added route: /coupons/:id -> CouponEdit component - Edit page now loads correctly 2. Created MultiSelect Component: - Shadcn-based multiselect with search - Badge display for selected items - Click badge X to remove - Shows +N more when exceeds maxDisplay - Searchable dropdown with Command component - Keyboard accessible Features: - Selected items shown as badges - Remove item by clicking X on badge - Search/filter options - Checkbox indicators - Max display limit (default 3) - Responsive and accessible Next: Add product/category/brand selectors to coupon form
This commit is contained in:
@@ -20,6 +20,7 @@ import ProductTags from '@/routes/Products/Tags';
|
||||
import ProductAttributes from '@/routes/Products/Attributes';
|
||||
import CouponsIndex from '@/routes/Coupons';
|
||||
import CouponNew from '@/routes/Coupons/New';
|
||||
import CouponEdit from '@/routes/Coupons/Edit';
|
||||
import CustomersIndex from '@/routes/Customers';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { LayoutDashboard, ReceiptText, Package, Tag, Users, Settings as SettingsIcon, Maximize2, Minimize2, Loader2 } from 'lucide-react';
|
||||
@@ -477,6 +478,7 @@ function AppRoutes() {
|
||||
{/* Coupons */}
|
||||
<Route path="/coupons" element={<CouponsIndex />} />
|
||||
<Route path="/coupons/new" element={<CouponNew />} />
|
||||
<Route path="/coupons/:id" element={<CouponEdit />} />
|
||||
|
||||
{/* Customers */}
|
||||
<Route path="/customers" element={<CustomersIndex />} />
|
||||
|
||||
Reference in New Issue
Block a user