@burdenoff/microfe-subscriberbot 2026.624.1 → 2026.626.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/subscriberbot/components/EmptyState.js +17 -10
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/InvestmentCard.js +23 -22
- package/dist/subscriberbot/components/InvestmentCard.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +15 -12
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +27 -15
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/RatingDisplay.js +3 -3
- package/dist/subscriberbot/components/RatingDisplay.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +25 -13
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/pages/HomePage.js +72 -63
- package/dist/subscriberbot/pages/HomePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +106 -100
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminDashboard.js +125 -85
- package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +51 -45
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +246 -241
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js +131 -129
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +247 -242
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/CartManagementPage.js +307 -302
- package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/UserManagementPage.js +308 -303
- package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +89 -84
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +269 -264
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +269 -227
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +191 -186
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +168 -166
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +344 -347
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +270 -272
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +294 -289
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/HelpSupportPage.js +156 -158
- package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js +94 -87
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/SettingsPage.js +749 -740
- package/dist/subscriberbot/pages/common/SettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +357 -324
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDetailPage.js +281 -247
- package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +106 -98
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CheckoutPage.js +235 -238
- package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js +426 -390
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +488 -479
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +522 -512
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/FavoritesPage.js +73 -66
- package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +75 -67
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +82 -76
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +100 -93
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/ReviewsPage.js +97 -90
- package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +86 -79
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +330 -293
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +269 -261
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +97 -91
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js +354 -322
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +118 -111
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +75 -69
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +435 -430
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +328 -289
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js +135 -103
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +120 -114
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +125 -120
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +354 -344
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentMethodsPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/customer/PaymentMethodsPage.tsx"],"sourcesContent":["/**\n * Payment Methods Page\n * @module subscriberbot/pages/customer\n *\n * Manage saved payment methods: UPI IDs, credit/debit cards, wallets.\n * Add Payment Method modal with type selection (Card/UPI/Wallet),\n * conditional forms, Quick Pay Options section (Cash on Delivery,\n * Pay at Cart), form state management, grouped display, security badge.\n */\n\nimport { useState } from 'react';\nimport {\n CreditCard,\n Smartphone,\n Wallet,\n Plus,\n Trash2,\n CheckCircle2,\n Shield,\n X,\n Banknote,\n ShoppingCart,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { EmptyState } from '../../components/EmptyState';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface PaymentMethod {\n id: string;\n type: 'upi' | 'card' | 'wallet';\n label: string;\n detail: string;\n icon: typeof CreditCard;\n isDefault: boolean;\n}\n\ninterface CardFormState {\n cardNumber: string;\n expiry: string;\n cvv: string;\n nameOnCard: string;\n}\n\ninterface UpiFormState {\n upiId: string;\n}\n\ninterface WalletFormState {\n walletProvider: string;\n mobile: string;\n}\n\n// ============================================================================\n// Mock Data\n// ============================================================================\n\nconst initialMethods: PaymentMethod[] = [\n {\n id: 'pm-1',\n type: 'upi',\n label: 'Google Pay',\n detail: 'priya@okaxis',\n icon: Smartphone,\n isDefault: true,\n },\n {\n id: 'pm-2',\n type: 'upi',\n label: 'PhonePe',\n detail: 'priya@ybl',\n icon: Smartphone,\n isDefault: false,\n },\n {\n id: 'pm-3',\n type: 'card',\n label: 'HDFC Credit Card',\n detail: '**** **** **** 4242',\n icon: CreditCard,\n isDefault: false,\n },\n {\n id: 'pm-4',\n type: 'card',\n label: 'SBI Debit Card',\n detail: '**** **** **** 8765',\n icon: CreditCard,\n isDefault: false,\n },\n {\n id: 'pm-5',\n type: 'wallet',\n label: 'SubscriberBot Wallet',\n detail: 'Balance: \\u20B9 1,250.00',\n icon: Wallet,\n isDefault: false,\n },\n];\n\n// ============================================================================\n// Payment Method Row\n// ============================================================================\n\nfunction PaymentMethodRow({\n method,\n onRemove,\n onSetDefault,\n}: {\n method: PaymentMethod;\n onRemove: (id: string) => void;\n onSetDefault: (id: string) => void;\n}) {\n const Icon = method.icon;\n\n return (\n <div\n className={cn(\n 'flex items-center gap-4 rounded-lg border p-4',\n method.isDefault ? 'border-foreground/30 bg-accent/50' : 'border-border-subtle bg-bg-surface'\n )}\n >\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken\">\n <Icon className=\"h-5 w-5 text-text-secondary\" />\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <p className=\"text-sm font-medium text-text-primary\">{method.label}</p>\n {method.isDefault && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Default\n </span>\n )}\n </div>\n <p className=\"mt-0.5 text-xs text-text-secondary font-mono\">{method.detail}</p>\n </div>\n\n <div className=\"flex items-center gap-1\">\n {!method.isDefault && (\n <button\n type=\"button\"\n onClick={() => onSetDefault(method.id)}\n title=\"Set as default\"\n className=\"rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n Set Default\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => onRemove(method.id)}\n title=\"Remove payment method\"\n className=\"rounded-md p-2 text-text-secondary hover:bg-status-error-bg/10 hover:text-status-error-text transition-colors\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function PaymentMethodsPage() {\n const { navigateTo } = useSubscriberBot();\n const [methods, setMethods] = useState<PaymentMethod[]>(initialMethods);\n const [showAddModal, setShowAddModal] = useState(false);\n const [selectedType, setSelectedType] = useState<'card' | 'upi' | 'wallet'>('card');\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n\n // Form states\n const [cardForm, setCardForm] = useState<CardFormState>({\n cardNumber: '',\n expiry: '',\n cvv: '',\n nameOnCard: '',\n });\n const [upiForm, setUpiForm] = useState<UpiFormState>({ upiId: '' });\n const [walletForm, setWalletForm] = useState<WalletFormState>({\n walletProvider: 'Paytm',\n mobile: '',\n });\n\n const showStatus = (msg: string) => {\n setStatusMessage(msg);\n setTimeout(() => setStatusMessage(null), 3000);\n };\n\n const resetForms = () => {\n setCardForm({ cardNumber: '', expiry: '', cvv: '', nameOnCard: '' });\n setUpiForm({ upiId: '' });\n setWalletForm({ walletProvider: 'Paytm', mobile: '' });\n setSelectedType('card');\n };\n\n const handleRemove = (id: string) => {\n setMethods((prev) => prev.filter((m) => m.id !== id));\n showStatus('Payment method removed');\n };\n\n const handleSetDefault = (id: string) => {\n setMethods((prev) => prev.map((m) => ({ ...m, isDefault: m.id === id })));\n showStatus('Default payment method updated');\n };\n\n const handleAddPaymentMethod = () => {\n let label = '';\n let detail = '';\n let icon = CreditCard;\n\n if (selectedType === 'card') {\n if (\n !cardForm.cardNumber.trim() ||\n !cardForm.expiry.trim() ||\n !cardForm.cvv.trim() ||\n !cardForm.nameOnCard.trim()\n ) {\n alert('Please fill in all card fields.');\n return;\n }\n label = `${cardForm.nameOnCard}'s Card`;\n detail = `**** **** **** ${cardForm.cardNumber.slice(-4)}`;\n icon = CreditCard;\n } else if (selectedType === 'upi') {\n if (!upiForm.upiId.trim()) {\n alert('Please enter a UPI ID.');\n return;\n }\n label = 'UPI';\n detail = upiForm.upiId;\n icon = Smartphone;\n } else {\n if (!walletForm.mobile.trim()) {\n alert('Please enter mobile number.');\n return;\n }\n label = walletForm.walletProvider;\n detail = `Mobile: ${walletForm.mobile}`;\n icon = Wallet;\n }\n\n const newMethod: PaymentMethod = {\n id: `pm-${Date.now()}`,\n type: selectedType,\n label,\n detail,\n icon,\n isDefault: false,\n };\n\n setMethods((prev) => [...prev, newMethod]);\n resetForms();\n setShowAddModal(false);\n showStatus('Payment method added successfully');\n };\n\n const grouped = {\n upi: methods.filter((m) => m.type === 'upi'),\n card: methods.filter((m) => m.type === 'card'),\n wallet: methods.filter((m) => m.type === 'wallet'),\n };\n\n return (\n <PageLayout\n title=\"Payment Methods\"\n description=\"Manage your saved payment options\"\n actions={\n <button\n type=\"button\"\n onClick={() => setShowAddModal(true)}\n className={cn(\n 'flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity',\n 'bg-foreground text-background hover:opacity-90'\n )}\n >\n <Plus className=\"h-4 w-4\" />\n Add Method\n </button>\n }\n >\n {/* Status message */}\n {statusMessage && (\n <div className=\"mb-4 rounded-lg border border-green-500/30 bg-green-500/10 p-3 flex items-center gap-2\">\n <CheckCircle2 className=\"h-4 w-4 text-green-600 dark:text-green-400 shrink-0\" />\n <p className=\"text-sm text-green-600 dark:text-green-400\">{statusMessage}</p>\n </div>\n )}\n\n {methods.length > 0 ? (\n <div className=\"space-y-6\">\n {/* UPI */}\n {grouped.upi.length > 0 && (\n <section>\n <h3 className=\"text-sm font-semibold text-text-primary mb-3 flex items-center gap-2\">\n <Smartphone className=\"h-4 w-4 text-text-secondary\" />\n UPI\n </h3>\n <div className=\"space-y-2\">\n {grouped.upi.map((method) => (\n <PaymentMethodRow\n key={method.id}\n method={method}\n onRemove={handleRemove}\n onSetDefault={handleSetDefault}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Cards */}\n {grouped.card.length > 0 && (\n <section>\n <h3 className=\"text-sm font-semibold text-text-primary mb-3 flex items-center gap-2\">\n <CreditCard className=\"h-4 w-4 text-text-secondary\" />\n Cards\n </h3>\n <div className=\"space-y-2\">\n {grouped.card.map((method) => (\n <PaymentMethodRow\n key={method.id}\n method={method}\n onRemove={handleRemove}\n onSetDefault={handleSetDefault}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Wallets */}\n {grouped.wallet.length > 0 && (\n <section>\n <h3 className=\"text-sm font-semibold text-text-primary mb-3 flex items-center gap-2\">\n <Wallet className=\"h-4 w-4 text-text-secondary\" />\n Wallets\n </h3>\n <div className=\"space-y-2\">\n {grouped.wallet.map((method) => (\n <PaymentMethodRow\n key={method.id}\n method={method}\n onRemove={handleRemove}\n onSetDefault={handleSetDefault}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Security note */}\n <div className=\"flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <Shield className=\"mt-0.5 h-5 w-5 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">Secure Payments</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n Your payment information is encrypted and securely stored. We never share your\n financial details with third parties.\n </p>\n </div>\n </div>\n </div>\n ) : (\n <EmptyState\n icon={<CreditCard className=\"h-12 w-12\" />}\n title=\"No payment methods\"\n description=\"Add a payment method to make faster checkouts.\"\n action={\n <button\n type=\"button\"\n onClick={() => setShowAddModal(true)}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Add Payment Method\n </button>\n }\n />\n )}\n\n {/* Quick Pay Options */}\n <div className=\"mt-8\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4\">Quick Pay Options</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <div className=\"flex items-center gap-3 mb-2\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken\">\n <Banknote className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <h3 className=\"text-sm font-semibold text-text-primary\">Cash on Delivery</h3>\n </div>\n <p className=\"text-xs text-text-secondary mb-3\">Pay when you receive your order</p>\n <div className=\"flex items-center gap-2 text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"text-xs\">Available for all orders</span>\n </div>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <div className=\"flex items-center gap-3 mb-2\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken\">\n <ShoppingCart className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <h3 className=\"text-sm font-semibold text-text-primary\">Pay at Cart</h3>\n </div>\n <p className=\"text-xs text-text-secondary mb-3\">Pay directly to the vendor</p>\n <div className=\"flex items-center gap-2 text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"text-xs\">Supports all payment methods</span>\n </div>\n </div>\n </div>\n </div>\n\n {/* Add Payment Method Modal */}\n {showAddModal && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\">\n <div className=\"w-full max-w-md max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg\">\n <div className=\"p-5\">\n {/* Header */}\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Add Payment Method</h2>\n <button\n type=\"button\"\n onClick={() => {\n setShowAddModal(false);\n resetForms();\n }}\n className=\"rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n <p className=\"text-sm text-text-secondary mb-5\">\n Choose a payment method to add to your account\n </p>\n\n {/* Type Selection */}\n <div className=\"space-y-2 mb-5\">\n {[\n {\n value: 'card' as const,\n label: 'Credit/Debit Card',\n sub: 'Visa, Mastercard, Rupay',\n Icon: CreditCard,\n },\n {\n value: 'upi' as const,\n label: 'UPI',\n sub: 'Google Pay, PhonePe, Paytm',\n Icon: Smartphone,\n },\n {\n value: 'wallet' as const,\n label: 'Wallet',\n sub: 'Paytm, Amazon Pay, Mobikwik',\n Icon: Wallet,\n },\n ].map(({ value, label, sub, Icon }) => (\n <label\n key={value}\n className={cn(\n 'flex items-center gap-3 rounded-lg border p-3 cursor-pointer transition-colors',\n selectedType === value\n ? 'border-foreground bg-accent'\n : 'border-border-subtle hover:bg-accent'\n )}\n >\n <input\n type=\"radio\"\n name=\"paymentType\"\n value={value}\n checked={selectedType === value}\n onChange={() => setSelectedType(value)}\n className=\"h-4 w-4 shrink-0\"\n />\n <Icon className=\"h-5 w-5 text-text-secondary shrink-0\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{label}</p>\n <p className=\"text-xs text-text-secondary\">{sub}</p>\n </div>\n </label>\n ))}\n </div>\n\n {/* Card Form */}\n {selectedType === 'card' && (\n <div className=\"space-y-3\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Card Number\n </label>\n <input\n type=\"text\"\n placeholder=\"1234 5678 9012 3456\"\n value={cardForm.cardNumber}\n onChange={(e) => setCardForm((p) => ({ ...p, cardNumber: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Expiry Date\n </label>\n <input\n type=\"text\"\n placeholder=\"MM/YY\"\n value={cardForm.expiry}\n onChange={(e) => setCardForm((p) => ({ ...p, expiry: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">CVV</label>\n <input\n type=\"password\"\n placeholder=\"123\"\n value={cardForm.cvv}\n onChange={(e) => setCardForm((p) => ({ ...p, cvv: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Name on Card\n </label>\n <input\n type=\"text\"\n placeholder=\"John Doe\"\n value={cardForm.nameOnCard}\n onChange={(e) => setCardForm((p) => ({ ...p, nameOnCard: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n )}\n\n {/* UPI Form */}\n {selectedType === 'upi' && (\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">UPI ID</label>\n <input\n type=\"text\"\n placeholder=\"yourname@paytm\"\n value={upiForm.upiId}\n onChange={(e) => setUpiForm({ upiId: e.target.value })}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n )}\n\n {/* Wallet Form */}\n {selectedType === 'wallet' && (\n <div className=\"space-y-3\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Select Wallet\n </label>\n <select\n value={walletForm.walletProvider}\n onChange={(e) =>\n setWalletForm((p) => ({ ...p, walletProvider: e.target.value }))\n }\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option>Paytm</option>\n <option>Amazon Pay</option>\n <option>Mobikwik</option>\n <option>Freecharge</option>\n </select>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Mobile Number\n </label>\n <input\n type=\"tel\"\n placeholder=\"9876543210\"\n value={walletForm.mobile}\n onChange={(e) => setWalletForm((p) => ({ ...p, mobile: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex items-center gap-3 pt-5\">\n <button\n type=\"button\"\n onClick={handleAddPaymentMethod}\n className=\"flex-1 rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Add Payment Method\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setShowAddModal(false);\n resetForms();\n }}\n className=\"flex-1 rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n Cancel\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;AA6DA,IAAM,IAAkC;CACtC;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF;AAMD,SAAS,EAAiB,EACxB,WACA,aACA,mBAKC;CACD,IAAM,IAAO,EAAO;AAEpB,QACE,kBAAC,OAAD;EACE,WAAW,EACT,iDACA,EAAO,YAAY,sCAAsC,qCAC1D;YAJH;GAME,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD,EAAM,WAAU,+BAAgC,CAAA;IAC5C,CAAA;GAEN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAyC,EAAO;MAAU,CAAA,EACtE,EAAO,aACN,kBAAC,QAAD;MAAM,WAAU;gBAAhB,CACE,kBAAC,GAAD,EAAc,WAAU,WAAY,CAAA,EAAA,UAE/B;QAEL;QACN,kBAAC,KAAD;KAAG,WAAU;eAAgD,EAAO;KAAW,CAAA,CAC3E;;GAEN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,CAAC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,CACE,EAAA,CAAA;OAIP,MAAiB,YAChB,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;SAAO,WAAU;mBAAmD;SAE5D,CAAA,EACR,kBAAC,UAAD;SACE,OAAO,EAAW;SAClB,WAAW,MACT,GAAe,OAAO;UAAE,GAAG;UAAG,gBAAgB,EAAE,OAAO;UAAO,EAAE;SAElE,WAAU;mBALZ;UAOE,kBAAC,UAAD,EAAA,UAAQ,SAAc,CAAA;UACtB,kBAAC,UAAD,EAAA,UAAQ,cAAmB,CAAA;UAC3B,kBAAC,UAAD,EAAA,UAAQ,YAAiB,CAAA;UACzB,kBAAC,UAAD,EAAA,UAAQ,cAAmB,CAAA;UACpB;WACL,EAAA,CAAA,EACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;SAAO,WAAU;mBAAmD;SAE5D,CAAA,EACR,kBAAC,SAAD;SACE,MAAK;SACL,aAAY;SACZ,OAAO,EAAW;SAClB,WAAW,MAAM,GAAe,OAAO;UAAE,GAAG;UAAG,QAAQ,EAAE,OAAO;UAAO,EAAE;SACzE,WAAU;SACV,CAAA,CACE,EAAA,CAAA,CACF;;OAIR,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,UAAD;SACE,MAAK;SACL,SAAS;SACT,WAAU;mBACX;SAEQ,CAAA,EACT,kBAAC,UAAD;SACE,MAAK;SACL,eAAe;AAEb,UADA,EAAgB,GAAM,EACtB,GAAY;;SAEd,WAAU;mBACX;SAEQ,CAAA,CACL;;OACF;;KACF,CAAA;IACF,CAAA;GAEG"}
|
|
1
|
+
{"version":3,"file":"PaymentMethodsPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/customer/PaymentMethodsPage.tsx"],"sourcesContent":["/**\n * Payment Methods Page\n * @module subscriberbot/pages/customer\n *\n * Manage saved payment methods: UPI IDs, credit/debit cards, wallets.\n * Add Payment Method modal with type selection (Card/UPI/Wallet),\n * conditional forms, Quick Pay Options section (Cash on Delivery,\n * Pay at Cart), form state management, grouped display, security badge.\n */\n\nimport { useState } from 'react';\nimport {\n CreditCard,\n Smartphone,\n Wallet,\n Plus,\n Trash2,\n CheckCircle2,\n Shield,\n X,\n Banknote,\n ShoppingCart,\n} from 'lucide-react';\nimport { PagePurpose, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { EmptyState } from '../../components/EmptyState';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface PaymentMethod {\n id: string;\n type: 'upi' | 'card' | 'wallet';\n label: string;\n detail: string;\n icon: typeof CreditCard;\n isDefault: boolean;\n}\n\ninterface CardFormState {\n cardNumber: string;\n expiry: string;\n cvv: string;\n nameOnCard: string;\n}\n\ninterface UpiFormState {\n upiId: string;\n}\n\ninterface WalletFormState {\n walletProvider: string;\n mobile: string;\n}\n\n// ============================================================================\n// Mock Data\n// ============================================================================\n\nconst initialMethods: PaymentMethod[] = [\n {\n id: 'pm-1',\n type: 'upi',\n label: 'Google Pay',\n detail: 'priya@okaxis',\n icon: Smartphone,\n isDefault: true,\n },\n {\n id: 'pm-2',\n type: 'upi',\n label: 'PhonePe',\n detail: 'priya@ybl',\n icon: Smartphone,\n isDefault: false,\n },\n {\n id: 'pm-3',\n type: 'card',\n label: 'HDFC Credit Card',\n detail: '**** **** **** 4242',\n icon: CreditCard,\n isDefault: false,\n },\n {\n id: 'pm-4',\n type: 'card',\n label: 'SBI Debit Card',\n detail: '**** **** **** 8765',\n icon: CreditCard,\n isDefault: false,\n },\n {\n id: 'pm-5',\n type: 'wallet',\n label: 'SubscriberBot Wallet',\n detail: 'Balance: \\u20B9 1,250.00',\n icon: Wallet,\n isDefault: false,\n },\n];\n\n// ============================================================================\n// Payment Method Row\n// ============================================================================\n\nfunction PaymentMethodRow({\n method,\n onRemove,\n onSetDefault,\n}: {\n method: PaymentMethod;\n onRemove: (id: string) => void;\n onSetDefault: (id: string) => void;\n}) {\n const Icon = method.icon;\n\n return (\n <div\n className={cn(\n 'flex items-center gap-4 rounded-lg border p-4',\n method.isDefault ? 'border-foreground/30 bg-accent/50' : 'border-border-seam bg-bg-surface'\n )}\n >\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken\">\n <Icon className=\"h-5 w-5 text-text-secondary\" />\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <p className=\"text-sm font-medium text-text-primary\">{method.label}</p>\n {method.isDefault && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-status-success-bg/10 px-2 py-0.5 text-[10px] font-medium text-status-success-text\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Default\n </span>\n )}\n </div>\n <p className=\"mt-0.5 text-xs text-text-secondary font-mono\">{method.detail}</p>\n </div>\n\n <div className=\"flex items-center gap-1\">\n {!method.isDefault && (\n <button\n type=\"button\"\n onClick={() => onSetDefault(method.id)}\n title=\"Set as default\"\n className=\"rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n Set Default\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => onRemove(method.id)}\n title=\"Remove payment method\"\n className=\"rounded-md p-2 text-text-secondary hover:bg-status-error-bg/10 hover:text-status-error-text transition-colors\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function PaymentMethodsPage() {\n const { navigateTo } = useSubscriberBot();\n const [methods, setMethods] = useState<PaymentMethod[]>(initialMethods);\n const [showAddModal, setShowAddModal] = useState(false);\n const [selectedType, setSelectedType] = useState<'card' | 'upi' | 'wallet'>('card');\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n\n // Form states\n const [cardForm, setCardForm] = useState<CardFormState>({\n cardNumber: '',\n expiry: '',\n cvv: '',\n nameOnCard: '',\n });\n const [upiForm, setUpiForm] = useState<UpiFormState>({ upiId: '' });\n const [walletForm, setWalletForm] = useState<WalletFormState>({\n walletProvider: 'Paytm',\n mobile: '',\n });\n\n const showStatus = (msg: string) => {\n setStatusMessage(msg);\n setTimeout(() => setStatusMessage(null), 3000);\n };\n\n const resetForms = () => {\n setCardForm({ cardNumber: '', expiry: '', cvv: '', nameOnCard: '' });\n setUpiForm({ upiId: '' });\n setWalletForm({ walletProvider: 'Paytm', mobile: '' });\n setSelectedType('card');\n };\n\n const handleRemove = (id: string) => {\n setMethods((prev) => prev.filter((m) => m.id !== id));\n showStatus('Payment method removed');\n };\n\n const handleSetDefault = (id: string) => {\n setMethods((prev) => prev.map((m) => ({ ...m, isDefault: m.id === id })));\n showStatus('Default payment method updated');\n };\n\n const handleAddPaymentMethod = () => {\n let label = '';\n let detail = '';\n let icon = CreditCard;\n\n if (selectedType === 'card') {\n if (\n !cardForm.cardNumber.trim() ||\n !cardForm.expiry.trim() ||\n !cardForm.cvv.trim() ||\n !cardForm.nameOnCard.trim()\n ) {\n alert('Please fill in all card fields.');\n return;\n }\n label = `${cardForm.nameOnCard}'s Card`;\n detail = `**** **** **** ${cardForm.cardNumber.slice(-4)}`;\n icon = CreditCard;\n } else if (selectedType === 'upi') {\n if (!upiForm.upiId.trim()) {\n alert('Please enter a UPI ID.');\n return;\n }\n label = 'UPI';\n detail = upiForm.upiId;\n icon = Smartphone;\n } else {\n if (!walletForm.mobile.trim()) {\n alert('Please enter mobile number.');\n return;\n }\n label = walletForm.walletProvider;\n detail = `Mobile: ${walletForm.mobile}`;\n icon = Wallet;\n }\n\n const newMethod: PaymentMethod = {\n id: `pm-${Date.now()}`,\n type: selectedType,\n label,\n detail,\n icon,\n isDefault: false,\n };\n\n setMethods((prev) => [...prev, newMethod]);\n resetForms();\n setShowAddModal(false);\n showStatus('Payment method added successfully');\n };\n\n const grouped = {\n upi: methods.filter((m) => m.type === 'upi'),\n card: methods.filter((m) => m.type === 'card'),\n wallet: methods.filter((m) => m.type === 'wallet'),\n };\n\n return (\n <PageLayout\n title=\"Payment Methods\"\n description=\"Manage your saved payment options\"\n actions={\n <button\n type=\"button\"\n onClick={() => setShowAddModal(true)}\n className={cn(\n 'flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity',\n 'bg-foreground text-background hover:opacity-90'\n )}\n >\n <Plus className=\"h-4 w-4\" />\n Add Method\n </button>\n }\n >\n <PagePurpose icon={<CreditCard className=\"h-4 w-4\" />} className=\"mb-6\">\n Save the cards and UPI options you pay with so checkout is fast and you don't have\n to re-enter details each time. Set a default for one-tap payment, and add or remove\n methods whenever they change. Your full card numbers are never stored here — only a\n secure reference.\n </PagePurpose>\n\n {/* Status message */}\n {statusMessage && (\n <div className=\"mb-4 rounded-lg border border-status-success-border/30 bg-status-success-bg/10 p-3 flex items-center gap-2\">\n <CheckCircle2 className=\"h-4 w-4 text-status-success-text shrink-0\" />\n <p className=\"text-sm text-status-success-text\">{statusMessage}</p>\n </div>\n )}\n\n {methods.length > 0 ? (\n <EmphasisPanel className=\"space-y-6\">\n {/* UPI */}\n {grouped.upi.length > 0 && (\n <section>\n <h3 className=\"text-sm font-semibold text-text-primary mb-3 flex items-center gap-2\">\n <Smartphone className=\"h-4 w-4 text-text-secondary\" />\n UPI\n </h3>\n <div className=\"space-y-2\">\n {grouped.upi.map((method) => (\n <PaymentMethodRow\n key={method.id}\n method={method}\n onRemove={handleRemove}\n onSetDefault={handleSetDefault}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Cards */}\n {grouped.card.length > 0 && (\n <section>\n <h3 className=\"text-sm font-semibold text-text-primary mb-3 flex items-center gap-2\">\n <CreditCard className=\"h-4 w-4 text-text-secondary\" />\n Cards\n </h3>\n <div className=\"space-y-2\">\n {grouped.card.map((method) => (\n <PaymentMethodRow\n key={method.id}\n method={method}\n onRemove={handleRemove}\n onSetDefault={handleSetDefault}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Wallets */}\n {grouped.wallet.length > 0 && (\n <section>\n <h3 className=\"text-sm font-semibold text-text-primary mb-3 flex items-center gap-2\">\n <Wallet className=\"h-4 w-4 text-text-secondary\" />\n Wallets\n </h3>\n <div className=\"space-y-2\">\n {grouped.wallet.map((method) => (\n <PaymentMethodRow\n key={method.id}\n method={method}\n onRemove={handleRemove}\n onSetDefault={handleSetDefault}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Security note */}\n <div className=\"flex items-start gap-3 rounded-lg border border-border-seam bg-bg-surface p-4\">\n <Shield className=\"mt-0.5 h-5 w-5 shrink-0 text-text-secondary\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">Secure Payments</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n Your payment information is encrypted and securely stored. We never share your\n financial details with third parties.\n </p>\n </div>\n </div>\n </EmphasisPanel>\n ) : (\n <EmptyState\n illustration=\"empty-data\"\n icon={<CreditCard className=\"h-12 w-12\" />}\n title=\"No payment methods\"\n description=\"Add a payment method to make faster checkouts.\"\n action={\n <button\n type=\"button\"\n onClick={() => setShowAddModal(true)}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Add Payment Method\n </button>\n }\n />\n )}\n\n {/* Quick Pay Options */}\n <div className=\"mt-8\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4\">Quick Pay Options</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-center gap-3 mb-2\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken\">\n <Banknote className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <h3 className=\"text-sm font-semibold text-text-primary\">Cash on Delivery</h3>\n </div>\n <p className=\"text-xs text-text-secondary mb-3\">Pay when you receive your order</p>\n <div className=\"flex items-center gap-2 text-status-success-text\">\n <CheckCircle2 className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"text-xs\">Available for all orders</span>\n </div>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-center gap-3 mb-2\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken\">\n <ShoppingCart className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <h3 className=\"text-sm font-semibold text-text-primary\">Pay at Cart</h3>\n </div>\n <p className=\"text-xs text-text-secondary mb-3\">Pay directly to the vendor</p>\n <div className=\"flex items-center gap-2 text-status-success-text\">\n <CheckCircle2 className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"text-xs\">Supports all payment methods</span>\n </div>\n </div>\n </div>\n </div>\n\n {/* Add Payment Method Modal */}\n {showAddModal && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-bg-canvas/50 p-4\">\n <div className=\"w-full max-w-md max-h-[90vh] overflow-y-auto rounded-lg border border-border-seam bg-bg-surface shadow-lg\">\n <div className=\"p-5\">\n {/* Header */}\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Add Payment Method</h2>\n <button\n type=\"button\"\n onClick={() => {\n setShowAddModal(false);\n resetForms();\n }}\n className=\"rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n <p className=\"text-sm text-text-secondary mb-5\">\n Choose a payment method to add to your account\n </p>\n\n {/* Type Selection */}\n <div className=\"space-y-2 mb-5\">\n {[\n {\n value: 'card' as const,\n label: 'Credit/Debit Card',\n sub: 'Visa, Mastercard, Rupay',\n Icon: CreditCard,\n },\n {\n value: 'upi' as const,\n label: 'UPI',\n sub: 'Google Pay, PhonePe, Paytm',\n Icon: Smartphone,\n },\n {\n value: 'wallet' as const,\n label: 'Wallet',\n sub: 'Paytm, Amazon Pay, Mobikwik',\n Icon: Wallet,\n },\n ].map(({ value, label, sub, Icon }) => (\n <label\n key={value}\n className={cn(\n 'flex items-center gap-3 rounded-lg border p-3 cursor-pointer transition-colors',\n selectedType === value\n ? 'border-foreground bg-accent'\n : 'border-border-seam hover:bg-accent'\n )}\n >\n <input\n type=\"radio\"\n name=\"paymentType\"\n value={value}\n checked={selectedType === value}\n onChange={() => setSelectedType(value)}\n className=\"h-4 w-4 shrink-0\"\n />\n <Icon className=\"h-5 w-5 text-text-secondary shrink-0\" />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{label}</p>\n <p className=\"text-xs text-text-secondary\">{sub}</p>\n </div>\n </label>\n ))}\n </div>\n\n {/* Card Form */}\n {selectedType === 'card' && (\n <div className=\"space-y-3\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Card Number\n </label>\n <input\n type=\"text\"\n placeholder=\"1234 5678 9012 3456\"\n value={cardForm.cardNumber}\n onChange={(e) => setCardForm((p) => ({ ...p, cardNumber: e.target.value }))}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Expiry Date\n </label>\n <input\n type=\"text\"\n placeholder=\"MM/YY\"\n value={cardForm.expiry}\n onChange={(e) => setCardForm((p) => ({ ...p, expiry: e.target.value }))}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n CVV\n </label>\n <input\n type=\"password\"\n placeholder=\"123\"\n value={cardForm.cvv}\n onChange={(e) => setCardForm((p) => ({ ...p, cvv: e.target.value }))}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Name on Card\n </label>\n <input\n type=\"text\"\n placeholder=\"John Doe\"\n value={cardForm.nameOnCard}\n onChange={(e) => setCardForm((p) => ({ ...p, nameOnCard: e.target.value }))}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n )}\n\n {/* UPI Form */}\n {selectedType === 'upi' && (\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">UPI ID</label>\n <input\n type=\"text\"\n placeholder=\"yourname@paytm\"\n value={upiForm.upiId}\n onChange={(e) => setUpiForm({ upiId: e.target.value })}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n )}\n\n {/* Wallet Form */}\n {selectedType === 'wallet' && (\n <div className=\"space-y-3\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Select Wallet\n </label>\n <select\n value={walletForm.walletProvider}\n onChange={(e) =>\n setWalletForm((p) => ({ ...p, walletProvider: e.target.value }))\n }\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option>Paytm</option>\n <option>Amazon Pay</option>\n <option>Mobikwik</option>\n <option>Freecharge</option>\n </select>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Mobile Number\n </label>\n <input\n type=\"tel\"\n placeholder=\"9876543210\"\n value={walletForm.mobile}\n onChange={(e) => setWalletForm((p) => ({ ...p, mobile: e.target.value }))}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex items-center gap-3 pt-5\">\n <button\n type=\"button\"\n onClick={handleAddPaymentMethod}\n className=\"flex-1 rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Add Payment Method\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setShowAddModal(false);\n resetForms();\n }}\n className=\"flex-1 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n Cancel\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;AA8DA,IAAM,IAAkC;CACtC;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF;AAMD,SAAS,EAAiB,EACxB,WACA,aACA,mBAKC;CACD,IAAM,IAAO,EAAO;AAEpB,QACE,kBAAC,OAAD;EACE,WAAW,EACT,iDACA,EAAO,YAAY,sCAAsC,mCAC1D;YAJH;GAME,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD,EAAM,WAAU,+BAAgC,CAAA;IAC5C,CAAA;GAEN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAy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,UAAD;SACE,MAAK;SACL,eAAe;AAEb,UADA,EAAgB,GAAM,EACtB,GAAY;;SAEd,WAAU;mBACX;SAEQ,CAAA,CACL;;OACF;;KACF,CAAA;IACF,CAAA;GAEG"}
|
|
@@ -7,17 +7,18 @@ import { RatingDisplay as a } from "../../components/RatingDisplay.js";
|
|
|
7
7
|
import { useCallback as o, useState as s } from "react";
|
|
8
8
|
import { CheckCircle2 as c, Info as l, MessageCircle as u, MessageSquare as d, PenSquare as f, Search as p, Star as m, ThumbsUp as h, X as g } from "lucide-react";
|
|
9
9
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
|
+
import { EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
10
11
|
//#region src/subscriberbot/pages/customer/ReviewsPage.tsx
|
|
11
|
-
var
|
|
12
|
+
var x = "user-001", S = {
|
|
12
13
|
1: "Terrible",
|
|
13
14
|
2: "Poor",
|
|
14
15
|
3: "Average",
|
|
15
16
|
4: "Good",
|
|
16
17
|
5: "Excellent"
|
|
17
|
-
},
|
|
18
|
+
}, C = [
|
|
18
19
|
{
|
|
19
20
|
id: "review-001",
|
|
20
|
-
userId:
|
|
21
|
+
userId: x,
|
|
21
22
|
userName: "Rahul Sharma",
|
|
22
23
|
userAvatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100",
|
|
23
24
|
itemId: "FOOD-001",
|
|
@@ -80,7 +81,7 @@ var y = "user-001", b = {
|
|
|
80
81
|
},
|
|
81
82
|
{
|
|
82
83
|
id: "review-004",
|
|
83
|
-
userId:
|
|
84
|
+
userId: x,
|
|
84
85
|
userName: "Rahul Sharma",
|
|
85
86
|
userAvatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100",
|
|
86
87
|
itemId: "prod-001",
|
|
@@ -122,7 +123,7 @@ var y = "user-001", b = {
|
|
|
122
123
|
createdAt: "2024-06-12T12:20:00Z"
|
|
123
124
|
}
|
|
124
125
|
];
|
|
125
|
-
function
|
|
126
|
+
function w({ value: e, onChange: n }) {
|
|
126
127
|
let [r, i] = s(0), a = r || e;
|
|
127
128
|
return /* @__PURE__ */ v("div", {
|
|
128
129
|
className: "flex items-center gap-3",
|
|
@@ -140,37 +141,37 @@ function S({ value: e, onChange: n }) {
|
|
|
140
141
|
onMouseEnter: () => i(e),
|
|
141
142
|
onMouseLeave: () => i(0),
|
|
142
143
|
className: "p-0.5 transition-transform",
|
|
143
|
-
children: /* @__PURE__ */ _(m, { className: t("h-6 w-6", e <= a ? "fill-
|
|
144
|
+
children: /* @__PURE__ */ _(m, { className: t("h-6 w-6", e <= a ? "fill-status-warning-text text-status-warning-text" : "fill-none text-text-secondary/40") })
|
|
144
145
|
}, e))
|
|
145
146
|
}), /* @__PURE__ */ _("span", {
|
|
146
147
|
className: "text-sm font-medium text-text-secondary",
|
|
147
|
-
children:
|
|
148
|
+
children: S[a] ?? ""
|
|
148
149
|
})]
|
|
149
150
|
});
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
-
let { navigateTo:
|
|
152
|
+
function T() {
|
|
153
|
+
let { navigateTo: S } = e(), [T, E] = s(C), [D, O] = s(!1), [k, A] = s({
|
|
153
154
|
rating: 5,
|
|
154
155
|
title: "",
|
|
155
156
|
comment: ""
|
|
156
|
-
}), [
|
|
157
|
+
}), [j, M] = s({
|
|
157
158
|
searchQuery: "",
|
|
158
159
|
type: "all",
|
|
159
160
|
rating: "",
|
|
160
161
|
sortBy: "recent"
|
|
161
|
-
}), [
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
let e = [...
|
|
165
|
-
if (
|
|
166
|
-
let t = parseInt(
|
|
162
|
+
}), [N, P] = s(null), F = (e) => {
|
|
163
|
+
P(e), setTimeout(() => P(null), 3e3);
|
|
164
|
+
}, I = o(() => {
|
|
165
|
+
let e = [...T];
|
|
166
|
+
if (j.type === "my-reviews" ? e = e.filter((e) => e.userId === x) : j.type !== "all" && (e = e.filter((e) => e.itemType === j.type)), j.rating) {
|
|
167
|
+
let t = parseInt(j.rating, 10);
|
|
167
168
|
e = e.filter((e) => e.rating === t);
|
|
168
169
|
}
|
|
169
|
-
if (
|
|
170
|
-
let t =
|
|
170
|
+
if (j.searchQuery) {
|
|
171
|
+
let t = j.searchQuery.toLowerCase();
|
|
171
172
|
e = e.filter((e) => e.itemName.toLowerCase().includes(t) || e.title.toLowerCase().includes(t) || e.comment.toLowerCase().includes(t) || e.cartName.toLowerCase().includes(t));
|
|
172
173
|
}
|
|
173
|
-
switch (
|
|
174
|
+
switch (j.sortBy) {
|
|
174
175
|
case "recent":
|
|
175
176
|
e.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
|
|
176
177
|
break;
|
|
@@ -185,14 +186,14 @@ function C() {
|
|
|
185
186
|
break;
|
|
186
187
|
}
|
|
187
188
|
return e;
|
|
188
|
-
}, [
|
|
189
|
-
if (!
|
|
189
|
+
}, [T, j])(), L = T.filter((e) => e.userId === x).length, R = T.length > 0 ? (T.reduce((e, t) => e + t.rating, 0) / T.length).toFixed(1) : "0", z = () => {
|
|
190
|
+
if (!k.title.trim() || !k.comment.trim()) {
|
|
190
191
|
alert("Please fill in the Review Title and Comment.");
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
194
|
let e = {
|
|
194
195
|
id: `review-${Date.now()}`,
|
|
195
|
-
userId:
|
|
196
|
+
userId: x,
|
|
196
197
|
userName: "Rahul Sharma",
|
|
197
198
|
userAvatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100",
|
|
198
199
|
itemId: "FOOD-001",
|
|
@@ -201,21 +202,21 @@ function C() {
|
|
|
201
202
|
cartId: "FOOD-001",
|
|
202
203
|
cartName: "Dosa Express",
|
|
203
204
|
orderId: `ORD-2024-${Date.now()}`,
|
|
204
|
-
rating:
|
|
205
|
-
title:
|
|
206
|
-
comment:
|
|
205
|
+
rating: k.rating,
|
|
206
|
+
title: k.title,
|
|
207
|
+
comment: k.comment,
|
|
207
208
|
helpfulCount: 0,
|
|
208
209
|
isHelpful: !1,
|
|
209
210
|
isVerified: !0,
|
|
210
211
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
211
212
|
};
|
|
212
|
-
|
|
213
|
+
E((t) => [e, ...t]), A({
|
|
213
214
|
rating: 5,
|
|
214
215
|
title: "",
|
|
215
216
|
comment: ""
|
|
216
|
-
}),
|
|
217
|
-
},
|
|
218
|
-
|
|
217
|
+
}), O(!1), F("Review submitted successfully!");
|
|
218
|
+
}, B = (e) => {
|
|
219
|
+
E((t) => t.map((t) => t.id === e ? {
|
|
219
220
|
...t,
|
|
220
221
|
isHelpful: !t.isHelpful,
|
|
221
222
|
helpfulCount: t.isHelpful ? t.helpfulCount - 1 : t.helpfulCount + 1
|
|
@@ -223,38 +224,43 @@ function C() {
|
|
|
223
224
|
};
|
|
224
225
|
return /* @__PURE__ */ v(n, {
|
|
225
226
|
title: "Reviews & Ratings",
|
|
226
|
-
description: `${
|
|
227
|
+
description: `${I.length} reviews found`,
|
|
227
228
|
actions: /* @__PURE__ */ v("button", {
|
|
228
229
|
type: "button",
|
|
229
|
-
onClick: () =>
|
|
230
|
+
onClick: () => O(!0),
|
|
230
231
|
className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity", "bg-foreground text-background hover:opacity-90"),
|
|
231
232
|
children: [/* @__PURE__ */ _(f, { className: "h-4 w-4" }), "Write Review"]
|
|
232
233
|
}),
|
|
233
234
|
children: [
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
/* @__PURE__ */ _(b, {
|
|
236
|
+
icon: /* @__PURE__ */ _(m, { className: "h-4 w-4" }),
|
|
237
|
+
className: "mb-6",
|
|
238
|
+
children: "Share your experience and read what others think. Write reviews for carts you've ordered from to help the community find great service, and revisit your own ratings any time. Honest feedback keeps quality high and helps good carts stand out."
|
|
239
|
+
}),
|
|
240
|
+
N && /* @__PURE__ */ v("div", {
|
|
241
|
+
className: "mb-4 rounded-lg border border-status-success-border/30 bg-status-success-bg/10 p-3 flex items-center gap-2",
|
|
242
|
+
children: [/* @__PURE__ */ _(c, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ _("p", {
|
|
243
|
+
className: "text-sm text-status-success-text",
|
|
244
|
+
children: N
|
|
239
245
|
})]
|
|
240
246
|
}),
|
|
241
|
-
/* @__PURE__ */ v(
|
|
247
|
+
/* @__PURE__ */ v(y, {
|
|
242
248
|
className: "flex flex-wrap items-center gap-4 text-sm text-text-secondary mb-6",
|
|
243
249
|
children: [
|
|
244
|
-
/* @__PURE__ */ v("span", { children: [
|
|
245
|
-
/* @__PURE__ */ v("span", { children: [
|
|
250
|
+
/* @__PURE__ */ v("span", { children: [T.length, " total reviews"] }),
|
|
251
|
+
/* @__PURE__ */ v("span", { children: [L, " your reviews"] }),
|
|
246
252
|
/* @__PURE__ */ v("span", {
|
|
247
253
|
className: "flex items-center gap-1",
|
|
248
254
|
children: [
|
|
249
255
|
"Average: ",
|
|
250
|
-
|
|
251
|
-
/* @__PURE__ */ _(m, { className: "h-3.5 w-3.5 fill-
|
|
256
|
+
R,
|
|
257
|
+
/* @__PURE__ */ _(m, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" })
|
|
252
258
|
]
|
|
253
259
|
})
|
|
254
260
|
]
|
|
255
261
|
}),
|
|
256
262
|
/* @__PURE__ */ _("div", {
|
|
257
|
-
className: "rounded-lg border border-border-
|
|
263
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4 mb-6",
|
|
258
264
|
children: /* @__PURE__ */ v("div", {
|
|
259
265
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
|
|
260
266
|
children: [
|
|
@@ -263,21 +269,21 @@ function C() {
|
|
|
263
269
|
children: [/* @__PURE__ */ _(p, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ _("input", {
|
|
264
270
|
type: "text",
|
|
265
271
|
placeholder: "Search reviews...",
|
|
266
|
-
value:
|
|
267
|
-
onChange: (e) =>
|
|
272
|
+
value: j.searchQuery,
|
|
273
|
+
onChange: (e) => M((t) => ({
|
|
268
274
|
...t,
|
|
269
275
|
searchQuery: e.target.value
|
|
270
276
|
})),
|
|
271
|
-
className: "w-full rounded-lg border border-border-
|
|
277
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
272
278
|
})]
|
|
273
279
|
}),
|
|
274
280
|
/* @__PURE__ */ v("select", {
|
|
275
|
-
value:
|
|
276
|
-
onChange: (e) =>
|
|
281
|
+
value: j.type,
|
|
282
|
+
onChange: (e) => M((t) => ({
|
|
277
283
|
...t,
|
|
278
284
|
type: e.target.value
|
|
279
285
|
})),
|
|
280
|
-
className: "w-full rounded-lg border border-border-
|
|
286
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
281
287
|
children: [
|
|
282
288
|
/* @__PURE__ */ _("option", {
|
|
283
289
|
value: "all",
|
|
@@ -298,12 +304,12 @@ function C() {
|
|
|
298
304
|
]
|
|
299
305
|
}),
|
|
300
306
|
/* @__PURE__ */ v("select", {
|
|
301
|
-
value:
|
|
302
|
-
onChange: (e) =>
|
|
307
|
+
value: j.rating,
|
|
308
|
+
onChange: (e) => M((t) => ({
|
|
303
309
|
...t,
|
|
304
310
|
rating: e.target.value
|
|
305
311
|
})),
|
|
306
|
-
className: "w-full rounded-lg border border-border-
|
|
312
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
307
313
|
children: [
|
|
308
314
|
/* @__PURE__ */ _("option", {
|
|
309
315
|
value: "",
|
|
@@ -332,12 +338,12 @@ function C() {
|
|
|
332
338
|
]
|
|
333
339
|
}),
|
|
334
340
|
/* @__PURE__ */ v("select", {
|
|
335
|
-
value:
|
|
336
|
-
onChange: (e) =>
|
|
341
|
+
value: j.sortBy,
|
|
342
|
+
onChange: (e) => M((t) => ({
|
|
337
343
|
...t,
|
|
338
344
|
sortBy: e.target.value
|
|
339
345
|
})),
|
|
340
|
-
className: "w-full rounded-lg border border-border-
|
|
346
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
341
347
|
children: [
|
|
342
348
|
/* @__PURE__ */ _("option", {
|
|
343
349
|
value: "recent",
|
|
@@ -360,22 +366,23 @@ function C() {
|
|
|
360
366
|
]
|
|
361
367
|
})
|
|
362
368
|
}),
|
|
363
|
-
|
|
369
|
+
I.length === 0 ? /* @__PURE__ */ _(r, {
|
|
370
|
+
illustration: "empty-data",
|
|
364
371
|
icon: /* @__PURE__ */ _(d, { className: "h-12 w-12" }),
|
|
365
372
|
title: "No reviews found",
|
|
366
373
|
description: "Be the first to write a review!",
|
|
367
374
|
action: /* @__PURE__ */ _("button", {
|
|
368
375
|
type: "button",
|
|
369
|
-
onClick: () =>
|
|
376
|
+
onClick: () => O(!0),
|
|
370
377
|
className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
|
|
371
378
|
children: "Write a Review"
|
|
372
379
|
})
|
|
373
380
|
}) : /* @__PURE__ */ _("div", {
|
|
374
381
|
className: "space-y-4",
|
|
375
|
-
children:
|
|
376
|
-
let n = e.userId ===
|
|
382
|
+
children: I.map((e) => {
|
|
383
|
+
let n = e.userId === x;
|
|
377
384
|
return /* @__PURE__ */ v("div", {
|
|
378
|
-
className: t("rounded-lg border bg-bg-surface p-5", n ? "border-foreground/20" : "border-border-
|
|
385
|
+
className: t("rounded-lg border bg-bg-surface p-5", n ? "border-foreground/20" : "border-border-seam"),
|
|
379
386
|
children: [
|
|
380
387
|
/* @__PURE__ */ v("div", {
|
|
381
388
|
className: "flex items-start gap-3 mb-3",
|
|
@@ -395,11 +402,11 @@ function C() {
|
|
|
395
402
|
children: e.userName
|
|
396
403
|
}),
|
|
397
404
|
e.isVerified && /* @__PURE__ */ v("span", {
|
|
398
|
-
className: "inline-flex items-center gap-1 rounded-full bg-
|
|
405
|
+
className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg/10 px-2 py-0.5 text-[10px] font-medium text-status-success-text",
|
|
399
406
|
children: [/* @__PURE__ */ _(c, { className: "h-3 w-3" }), "Verified"]
|
|
400
407
|
}),
|
|
401
408
|
n && /* @__PURE__ */ _("span", {
|
|
402
|
-
className: "inline-flex items-center rounded-full bg-
|
|
409
|
+
className: "inline-flex items-center rounded-full bg-status-info-bg/10 px-2 py-0.5 text-[10px] font-medium text-status-info-text",
|
|
403
410
|
children: "Your Review"
|
|
404
411
|
})
|
|
405
412
|
]
|
|
@@ -443,17 +450,17 @@ function C() {
|
|
|
443
450
|
}, t))
|
|
444
451
|
}),
|
|
445
452
|
e.response && /* @__PURE__ */ v("div", {
|
|
446
|
-
className: "mb-3 rounded-lg border border-
|
|
453
|
+
className: "mb-3 rounded-lg border border-status-info-border/20 bg-status-info-bg/5 p-3",
|
|
447
454
|
children: [/* @__PURE__ */ v("div", {
|
|
448
455
|
className: "flex flex-wrap items-center gap-2 mb-1.5",
|
|
449
456
|
children: [
|
|
450
|
-
/* @__PURE__ */ _(u, { className: "h-3.5 w-3.5 text-
|
|
457
|
+
/* @__PURE__ */ _(u, { className: "h-3.5 w-3.5 text-status-info-text" }),
|
|
451
458
|
/* @__PURE__ */ v("span", {
|
|
452
|
-
className: "text-xs font-medium text-
|
|
459
|
+
className: "text-xs font-medium text-status-info-text",
|
|
453
460
|
children: ["Response from ", e.response.respondedBy]
|
|
454
461
|
}),
|
|
455
462
|
/* @__PURE__ */ _("span", {
|
|
456
|
-
className: "text-[10px] text-
|
|
463
|
+
className: "text-[10px] text-status-info-text/70",
|
|
457
464
|
children: i(e.response.respondedAt, {
|
|
458
465
|
hour: void 0,
|
|
459
466
|
minute: void 0,
|
|
@@ -462,16 +469,16 @@ function C() {
|
|
|
462
469
|
})
|
|
463
470
|
]
|
|
464
471
|
}), /* @__PURE__ */ _("p", {
|
|
465
|
-
className: "text-xs text-
|
|
472
|
+
className: "text-xs text-status-info-text leading-relaxed",
|
|
466
473
|
children: e.response.message
|
|
467
474
|
})]
|
|
468
475
|
}),
|
|
469
476
|
/* @__PURE__ */ v("div", {
|
|
470
|
-
className: "flex items-center justify-between pt-3 border-t border-border-
|
|
477
|
+
className: "flex items-center justify-between pt-3 border-t border-border-seam",
|
|
471
478
|
children: [/* @__PURE__ */ v("button", {
|
|
472
479
|
type: "button",
|
|
473
|
-
onClick: () =>
|
|
474
|
-
className: t("flex items-center gap-1.5 text-xs transition-colors", e.isHelpful ? "text-
|
|
480
|
+
onClick: () => B(e.id),
|
|
481
|
+
className: t("flex items-center gap-1.5 text-xs transition-colors", e.isHelpful ? "text-status-info-text font-medium" : "text-text-secondary hover:text-text-primary"),
|
|
475
482
|
children: [
|
|
476
483
|
/* @__PURE__ */ _(h, { className: t("h-3.5 w-3.5", e.isHelpful && "fill-current") }),
|
|
477
484
|
"Helpful (",
|
|
@@ -482,7 +489,7 @@ function C() {
|
|
|
482
489
|
className: "flex items-center gap-3 text-xs text-text-secondary",
|
|
483
490
|
children: [/* @__PURE__ */ v("span", { children: ["Order: ", e.orderId] }), /* @__PURE__ */ _("button", {
|
|
484
491
|
type: "button",
|
|
485
|
-
onClick: () =>
|
|
492
|
+
onClick: () => S(`/customer/carts/${e.cartId}`),
|
|
486
493
|
className: "font-medium hover:text-text-primary transition-colors",
|
|
487
494
|
children: "View Cart"
|
|
488
495
|
})]
|
|
@@ -492,10 +499,10 @@ function C() {
|
|
|
492
499
|
}, e.id);
|
|
493
500
|
})
|
|
494
501
|
}),
|
|
495
|
-
|
|
496
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-
|
|
502
|
+
D && /* @__PURE__ */ _("div", {
|
|
503
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-canvas/50 p-4",
|
|
497
504
|
children: /* @__PURE__ */ _("div", {
|
|
498
|
-
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-
|
|
505
|
+
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-seam bg-bg-surface shadow-lg",
|
|
499
506
|
children: /* @__PURE__ */ v("div", {
|
|
500
507
|
className: "p-5",
|
|
501
508
|
children: [
|
|
@@ -506,7 +513,7 @@ function C() {
|
|
|
506
513
|
children: "Write a Review"
|
|
507
514
|
}), /* @__PURE__ */ _("button", {
|
|
508
515
|
type: "button",
|
|
509
|
-
onClick: () =>
|
|
516
|
+
onClick: () => O(!1),
|
|
510
517
|
className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
|
|
511
518
|
children: /* @__PURE__ */ _(g, { className: "h-4 w-4" })
|
|
512
519
|
})]
|
|
@@ -517,12 +524,12 @@ function C() {
|
|
|
517
524
|
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
518
525
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
519
526
|
children: ["Rating ", /* @__PURE__ */ _("span", {
|
|
520
|
-
className: "text-
|
|
527
|
+
className: "text-status-error-text",
|
|
521
528
|
children: "*"
|
|
522
529
|
})]
|
|
523
|
-
}), /* @__PURE__ */ _(
|
|
524
|
-
value:
|
|
525
|
-
onChange: (e) =>
|
|
530
|
+
}), /* @__PURE__ */ _(w, {
|
|
531
|
+
value: k.rating,
|
|
532
|
+
onChange: (e) => A((t) => ({
|
|
526
533
|
...t,
|
|
527
534
|
rating: e
|
|
528
535
|
}))
|
|
@@ -530,34 +537,34 @@ function C() {
|
|
|
530
537
|
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
531
538
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
532
539
|
children: ["Review Title ", /* @__PURE__ */ _("span", {
|
|
533
|
-
className: "text-
|
|
540
|
+
className: "text-status-error-text",
|
|
534
541
|
children: "*"
|
|
535
542
|
})]
|
|
536
543
|
}), /* @__PURE__ */ _("input", {
|
|
537
544
|
type: "text",
|
|
538
545
|
placeholder: "Summarize your experience",
|
|
539
|
-
value:
|
|
540
|
-
onChange: (e) =>
|
|
546
|
+
value: k.title,
|
|
547
|
+
onChange: (e) => A((t) => ({
|
|
541
548
|
...t,
|
|
542
549
|
title: e.target.value
|
|
543
550
|
})),
|
|
544
|
-
className: "w-full rounded-lg border border-border-
|
|
551
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
545
552
|
})] }),
|
|
546
553
|
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
547
554
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
548
555
|
children: ["Your Review ", /* @__PURE__ */ _("span", {
|
|
549
|
-
className: "text-
|
|
556
|
+
className: "text-status-error-text",
|
|
550
557
|
children: "*"
|
|
551
558
|
})]
|
|
552
559
|
}), /* @__PURE__ */ _("textarea", {
|
|
553
560
|
rows: 5,
|
|
554
561
|
placeholder: "Share your experience with others...",
|
|
555
|
-
value:
|
|
556
|
-
onChange: (e) =>
|
|
562
|
+
value: k.comment,
|
|
563
|
+
onChange: (e) => A((t) => ({
|
|
557
564
|
...t,
|
|
558
565
|
comment: e.target.value
|
|
559
566
|
})),
|
|
560
|
-
className: "w-full rounded-lg border border-border-
|
|
567
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
|
|
561
568
|
})] }),
|
|
562
569
|
/* @__PURE__ */ v("div", {
|
|
563
570
|
className: "rounded-lg bg-bg-sunken p-4",
|
|
@@ -583,13 +590,13 @@ function C() {
|
|
|
583
590
|
className: "flex items-center gap-3 pt-5",
|
|
584
591
|
children: [/* @__PURE__ */ _("button", {
|
|
585
592
|
type: "button",
|
|
586
|
-
onClick:
|
|
593
|
+
onClick: z,
|
|
587
594
|
className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
|
|
588
595
|
children: "Submit Review"
|
|
589
596
|
}), /* @__PURE__ */ _("button", {
|
|
590
597
|
type: "button",
|
|
591
|
-
onClick: () =>
|
|
592
|
-
className: "rounded-lg border border-border-
|
|
598
|
+
onClick: () => O(!1),
|
|
599
|
+
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
593
600
|
children: "Cancel"
|
|
594
601
|
})]
|
|
595
602
|
})
|
|
@@ -601,6 +608,6 @@ function C() {
|
|
|
601
608
|
});
|
|
602
609
|
}
|
|
603
610
|
//#endregion
|
|
604
|
-
export {
|
|
611
|
+
export { T as ReviewsPage };
|
|
605
612
|
|
|
606
613
|
//# sourceMappingURL=ReviewsPage.js.map
|