@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.2
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/healthybowl/components/BedLayoutGrid.js +128 -115
- package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
- package/dist/healthybowl/components/CropPicker.js +37 -0
- package/dist/healthybowl/components/CropPicker.js.map +1 -0
- package/dist/healthybowl/components/DataTable.js +125 -108
- package/dist/healthybowl/components/DataTable.js.map +1 -1
- package/dist/healthybowl/components/FilterBar.js +9 -6
- package/dist/healthybowl/components/FilterBar.js.map +1 -1
- package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
- package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
- package/dist/healthybowl/components/index.js +3 -1
- package/dist/healthybowl/hooks/useCropPage.js +71 -0
- package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
- package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
- package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
- package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
- package/dist/healthybowl/pages/HomePage.js +143 -142
- package/dist/healthybowl/pages/HomePage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
- package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
- package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
- package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
- package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
- package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
- package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
- package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
- package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
- package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
- package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
- package/dist/healthybowl/pages/network/EventsPage.js +16 -16
- package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
- package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
- package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
- package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
- package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
- package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
- package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
- package/dist/healthybowl/utils/cropComparison.js +1 -1
- package/dist/healthybowl/utils/cropComparison.js.map +1 -1
- package/dist/healthybowl/utils/cropPicker.js +35 -0
- package/dist/healthybowl/utils/cropPicker.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +2 -2
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/healthybowl/utils/quotaLabels.js +8 -0
- package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
- package/dist/healthybowl/utils/seedRate.js +1 -8
- package/dist/healthybowl/utils/seedRate.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpertsPage.js","names":[],"sources":["../../../../src/healthybowl/pages/network/ExpertsPage.tsx"],"sourcesContent":["import { useState, useRef, useEffect, type FC } from 'react';\nimport {\n Star,\n MapPin,\n Clock,\n Globe,\n Award,\n ArrowUpDown,\n ChevronDown,\n Eye,\n User,\n Zap,\n CalendarCheck,\n Plus,\n Pencil,\n Trash2,\n Wallet,\n} from 'lucide-react';\nimport {\n PageLayout,\n StatCard,\n FilterBar,\n StatusBadge,\n EmptyState,\n ErrorState,\n PageLoader,\n Modal,\n} from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useToast } from '../../hooks/useToast';\nimport { useConsultationPayments } from '../../hooks/useConsultationPayments';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport type {\n Consultation,\n ConsultationPaymentStatus,\n ConsultationStatus,\n ConsultationMode,\n Expert,\n} from '../../types';\nimport { cn, formatCurrency, HB_DEFAULT_CURRENCY, formatDateOnly, todayLocalDate } from '../../utils/helpers';\n\ntype BookingFormState = {\n topic: string;\n requestedDate: string;\n mode: string;\n notes: string;\n};\n\n// Video consultations are not yet wired to a live provider, so default to\n// phone and do not offer video as a bookable mode until BOFF-4719 is built.\nconst emptyBookingForm: BookingFormState = {\n topic: '',\n requestedDate: '',\n mode: 'phone',\n notes: '',\n};\n\ntype ExpertFormState = {\n name: string;\n specialization: string;\n experience: string;\n rating: string;\n location: string;\n availability: 'available' | 'busy' | 'offline';\n hourlyRate: string;\n languages: string;\n};\n\nconst emptyExpertForm: ExpertFormState = {\n name: '',\n specialization: '',\n experience: '',\n rating: '',\n location: '',\n availability: 'available',\n hourlyRate: '',\n languages: '',\n};\n\nconst consultationStatusVariant = (s: ConsultationStatus) => {\n switch (s) {\n case 'CONFIRMED':\n return 'success' as const;\n case 'COMPLETED':\n return 'info' as const;\n case 'CANCELLED':\n return 'muted' as const;\n case 'REQUESTED':\n default:\n return 'warning' as const;\n }\n};\n\nconst consultationPaymentVariant = (s: ConsultationPaymentStatus) => {\n switch (s) {\n case 'PAID':\n return 'success' as const;\n case 'REFUNDED':\n return 'error' as const;\n case 'PENDING':\n default:\n return 'warning' as const;\n }\n};\n\nconst specializations = [\n 'All',\n 'Organic Crop Science',\n 'Integrated Pest Management',\n 'Soil Science & Fertility',\n 'Livestock & Veterinary',\n 'Organic Certification',\n];\nconst availabilityOptions = ['All', 'Available', 'Busy'];\n\ntype SortOption = 'rating' | 'experience' | 'price-asc' | 'price-desc';\nconst sortOrder: SortOption[] = ['rating', 'experience', 'price-asc', 'price-desc'];\n\nconst availabilityVariant = (a: string) => {\n switch (a) {\n case 'available':\n return 'success' as const;\n case 'busy':\n return 'warning' as const;\n case 'offline':\n return 'muted' as const;\n default:\n return 'default' as const;\n }\n};\n\nfunction renderStars(rating: number) {\n return Array.from({ length: 5 }, (_, i) => (\n <Star key={i} className={cn('h-3.5 w-3.5', i < Math.round(rating) ? 'fill-warning text-warning' : 'text-muted')} />\n ));\n}\n\nexport const ExpertsPage: FC = () => {\n const { t } = useI18n();\n const {\n experts,\n consultations,\n createConsultation,\n updateConsultationStatus,\n createExpert,\n updateExpert,\n deleteExpert,\n errors,\n loadings,\n refetch,\n } = useHealthyBowlData();\n const { checkoutConsultation, syncConsultationPayment, loadRazorpay } = useConsultationPayments();\n\n // Video mode is intentionally omitted from the booking dropdown until the\n // video provider integration is implemented (BOFF-4719). Existing video\n // requests are still displayed with the \"coming soon\" label below.\n const consultationModes = [\n { value: 'phone', label: t('healthybowl.network.experts.modes.phone', 'Phone call') },\n { value: 'in_person', label: t('healthybowl.network.experts.modes.inPerson', 'In person') },\n ];\n\n const sortLabels: Record<SortOption, string> = {\n rating: t('healthybowl.network.experts.sort.rating', 'Rating'),\n experience: t('healthybowl.network.experts.sort.experience', 'Experience'),\n 'price-asc': t('healthybowl.network.experts.sort.priceAsc', 'Price: Low → High'),\n 'price-desc': t('healthybowl.network.experts.sort.priceDesc', 'Price: High → Low'),\n };\n\n const specializationLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n 'Organic Crop Science': t('healthybowl.network.experts.specializations.organicCropScience', 'Organic Crop Science'),\n 'Integrated Pest Management': t(\n 'healthybowl.network.experts.specializations.integratedPestManagement',\n 'Integrated Pest Management'\n ),\n 'Soil Science & Fertility': t(\n 'healthybowl.network.experts.specializations.soilScienceFertility',\n 'Soil Science & Fertility'\n ),\n 'Livestock & Veterinary': t(\n 'healthybowl.network.experts.specializations.livestockVeterinary',\n 'Livestock & Veterinary'\n ),\n 'Organic Certification': t(\n 'healthybowl.network.experts.specializations.organicCertification',\n 'Organic Certification'\n ),\n };\n\n const availabilityFilterLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n Available: t('healthybowl.network.experts.availabilityFilter.available', 'Available'),\n Busy: t('healthybowl.network.experts.availabilityFilter.busy', 'Busy'),\n };\n\n const availabilityDisplayLabels: Record<string, string> = {\n available: t('healthybowl.network.experts.availability.available', 'available'),\n busy: t('healthybowl.network.experts.availability.busy', 'busy'),\n offline: t('healthybowl.network.experts.availability.offline', 'offline'),\n };\n\n const consultationStatusLabels: Record<ConsultationStatus, string> = {\n REQUESTED: t('healthybowl.network.experts.consultationStatus.requested', 'REQUESTED'),\n CONFIRMED: t('healthybowl.network.experts.consultationStatus.confirmed', 'CONFIRMED'),\n COMPLETED: t('healthybowl.network.experts.consultationStatus.completed', 'COMPLETED'),\n CANCELLED: t('healthybowl.network.experts.consultationStatus.cancelled', 'CANCELLED'),\n };\n\n const consultationPaymentStatusLabels: Record<ConsultationPaymentStatus, string> = {\n PENDING: t('healthybowl.network.experts.paymentStatus.pending', 'Payment pending'),\n PAID: t('healthybowl.network.experts.paymentStatus.paid', 'Paid'),\n REFUNDED: t('healthybowl.network.experts.paymentStatus.refunded', 'Refunded'),\n };\n\n const consultationModeLabels: Record<string, string> = {\n video: t('healthybowl.network.experts.modes.video', 'Video call (coming soon)'),\n phone: t('healthybowl.network.experts.modes.phone', 'Phone call'),\n in_person: t('healthybowl.network.experts.modes.inPerson', 'In person'),\n };\n\n const [search, setSearch] = useState('');\n const [specFilter, setSpecFilter] = useState('All');\n const [availFilter, setAvailFilter] = useState('All');\n const [sort, setSort] = useState<SortOption>('rating');\n const [showSortDropdown, setShowSortDropdown] = useState(false);\n const [expandedExpert, setExpandedExpert] = useState<string | null>(null);\n const [bookingExpert, setBookingExpert] = useState<Expert | null>(null);\n const [bookingForm, setBookingForm] = useState<BookingFormState>(emptyBookingForm);\n const [submitting, setSubmitting] = useState(false);\n\n const [showExpertModal, setShowExpertModal] = useState(false);\n const [editingExpert, setEditingExpert] = useState<Expert | null>(null);\n const [expertForm, setExpertForm] = useState<ExpertFormState>(emptyExpertForm);\n const [savingExpert, setSavingExpert] = useState(false);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [updatingStatusId, setUpdatingStatusId] = useState<string | null>(null);\n // Several consultations can be paid concurrently; model each widget rather than letting one\n // checkout clobber another card's loading state. The ref closes the same-render double-click\n // window before React has committed the button's disabled state.\n const [payingIds, setPayingIds] = useState<ReadonlySet<string>>(() => new Set());\n const payingIdsRef = useRef(new Set<string>());\n\n const beginConsultationPayment = (consultationId: string): boolean => {\n if (payingIdsRef.current.has(consultationId)) return false;\n payingIdsRef.current.add(consultationId);\n setPayingIds(new Set(payingIdsRef.current));\n return true;\n };\n\n const finishConsultationPayment = (consultationId: string): void => {\n payingIdsRef.current.delete(consultationId);\n setPayingIds(new Set(payingIdsRef.current));\n };\n\n const expertAvailabilityOptions: { value: ExpertFormState['availability']; label: string }[] = [\n { value: 'available', label: t('healthybowl.network.experts.availability.available', 'available') },\n { value: 'busy', label: t('healthybowl.network.experts.availability.busy', 'busy') },\n { value: 'offline', label: t('healthybowl.network.experts.availability.offline', 'offline') },\n ];\n\n const sortRef = useRef<HTMLDivElement>(null);\n const { toasts, toast, dismiss } = useToast();\n\n const expertConsultations = consultations.filter((c) => c.consultantType === 'EXPERT');\n\n const updateBookingForm = <K extends keyof BookingFormState>(key: K, value: BookingFormState[K]) =>\n setBookingForm((prev) => ({ ...prev, [key]: value }));\n\n const openBooking = (expert: Expert) => {\n setBookingForm(emptyBookingForm);\n setBookingExpert(expert);\n };\n\n const closeBooking = () => {\n setBookingExpert(null);\n setBookingForm(emptyBookingForm);\n };\n\n const updateExpertForm = <K extends keyof ExpertFormState>(key: K, value: ExpertFormState[K]) =>\n setExpertForm((prev) => ({ ...prev, [key]: value }));\n\n const openCreateExpert = () => {\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n setShowExpertModal(true);\n };\n\n const openEditExpert = (expert: Expert) => {\n setEditingExpert(expert);\n setExpertForm({\n name: expert.name,\n specialization: expert.specialization,\n experience: String(expert.experience),\n rating: String(expert.rating),\n location: expert.location,\n availability: expert.availability,\n hourlyRate: String(expert.hourlyRate),\n languages: (expert.languages ?? []).join(', '),\n });\n setShowExpertModal(true);\n };\n\n const closeExpertModal = () => {\n setShowExpertModal(false);\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n };\n\n const handleSaveExpert = async () => {\n if (!expertForm.name.trim() || !expertForm.specialization.trim() || !expertForm.location.trim()) {\n toast({\n title: t('healthybowl.network.experts.form.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.form.toast.missingFields.description',\n 'Name, specialization, and location are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n const languages = expertForm.languages\n .split(',')\n .map((l) => l.trim())\n .filter((l) => l.length > 0);\n setSavingExpert(true);\n try {\n if (editingExpert) {\n await updateExpert({\n id: editingExpert.id,\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.updated.title', 'Expert updated'),\n description: t('healthybowl.network.experts.form.toast.updated.description', '{{name}} has been updated.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n } else {\n await createExpert({\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.created.title', 'Expert added'),\n description: t('healthybowl.network.experts.form.toast.created.description', '{{name}} has been added.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n }\n closeExpertModal();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.saveError.title', 'Could not save expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.saveError.description', 'Failed to save expert'),\n variant: 'error',\n });\n } finally {\n setSavingExpert(false);\n }\n };\n\n const handleDeleteExpert = async (expert: Expert) => {\n setDeletingId(expert.id);\n try {\n await deleteExpert(expert.id);\n toast({\n title: t('healthybowl.network.experts.form.toast.deleted.title', 'Expert removed'),\n description: t('healthybowl.network.experts.form.toast.deleted.description', '{{name}} has been removed.', {\n name: expert.name,\n }),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.deleteError.title', 'Could not remove expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.deleteError.description', 'Failed to remove expert'),\n variant: 'error',\n });\n } finally {\n setDeletingId(null);\n }\n };\n\n const handleBookConsultation = async () => {\n if (!bookingExpert) return;\n if (!bookingForm.topic.trim() || !bookingForm.requestedDate) {\n toast({\n title: t('healthybowl.network.experts.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.toast.missingFields.description',\n 'Topic and preferred date are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n setSubmitting(true);\n try {\n await createConsultation({\n consultantType: 'EXPERT',\n consultantId: bookingExpert.id,\n consultantName: bookingExpert.name,\n topic: bookingForm.topic.trim(),\n requestedDate: bookingForm.requestedDate,\n // The mode <select> only offers the three ConsultationMode values.\n mode: bookingForm.mode as ConsultationMode,\n notes: bookingForm.notes.trim() || undefined,\n fee: bookingExpert.hourlyRate,\n });\n toast({\n title: t('healthybowl.network.experts.toast.requested.title', 'Consultation requested'),\n description: t(\n 'healthybowl.network.experts.toast.requested.description',\n 'Your request to {{name}} has been sent.',\n { name: bookingExpert.name }\n ),\n variant: 'success',\n });\n closeBooking();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.toast.bookFailed.title', 'Could not book consultation'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.toast.bookFailed.description', 'Failed to book consultation'),\n variant: 'error',\n });\n } finally {\n setSubmitting(false);\n }\n };\n\n const handleUpdateStatus = async (id: string, status: ConsultationStatus) => {\n setUpdatingStatusId(id);\n try {\n await updateConsultationStatus({ id, status });\n toast({\n title: t('healthybowl.network.experts.toast.statusUpdated.title', 'Status updated'),\n description: t(\n 'healthybowl.network.experts.toast.statusUpdated.description',\n 'The consultation has been moved to {{status}}.',\n { status: consultationStatusLabels[status] ?? status }\n ),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.toast.statusUpdateError.title', 'Could not update status'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.toast.statusUpdateError.description', 'Failed to update status'),\n variant: 'error',\n });\n } finally {\n setUpdatingStatusId(null);\n }\n };\n\n /** Settle only through the server, which re-reads the authoritative platform-billing Payment. */\n const settleConsultationPayment = async (consultation: Consultation) => {\n try {\n const settled = await syncConsultationPayment(consultation.id);\n // The settlement result is authoritative; a failed list refresh must not make a confirmed\n // payment look like a failure.\n await refetch().catch(() => undefined);\n\n if (settled.paymentStatus === 'PAID') {\n toast({\n title: t('healthybowl.network.experts.payment.toast.paid.title', 'Payment confirmed'),\n description: settled.paymentReference\n ? t(\n 'healthybowl.network.experts.payment.toast.paid.withReference',\n 'Your consultation payment is confirmed — reference {{reference}}.',\n { reference: settled.paymentReference }\n )\n : t(\n 'healthybowl.network.experts.payment.toast.paid.description',\n 'Your consultation payment is confirmed.'\n ),\n variant: 'success',\n });\n } else {\n toast({\n title: t('healthybowl.network.experts.payment.toast.pending.title', 'Payment not completed'),\n description: t(\n 'healthybowl.network.experts.payment.toast.pending.description',\n 'This consultation is still awaiting payment. Nothing was charged — you can pay again any time.'\n ),\n variant: 'info',\n });\n }\n } finally {\n finishConsultationPayment(consultation.id);\n }\n };\n\n /**\n * Opens Razorpay using billing's runtime checkout details. Razorpay may call both `handler` and\n * `ondismiss` after a successful payment, so both routes share the one-shot settlement guard.\n */\n const handlePayNow = async (consultation: Consultation) => {\n if (!beginConsultationPayment(consultation.id)) return;\n let widgetOpened = false;\n\n try {\n const checkout = await checkoutConsultation(consultation.id);\n if (checkout.provider !== 'RAZORPAY') {\n toast({\n title: t(\n 'healthybowl.network.experts.payment.toast.unsupportedProvider.title',\n 'Unsupported payment provider'\n ),\n description: t(\n 'healthybowl.network.experts.payment.toast.unsupportedProvider.description',\n 'Billing routed this consultation to {{provider}}, which this checkout cannot open yet. Contact support for help.',\n { provider: checkout.provider }\n ),\n variant: 'warning',\n });\n return;\n }\n if (!checkout.providerOrderId || !checkout.razorpayKeyId) {\n toast({\n title: t('healthybowl.network.experts.payment.toast.checkoutIncomplete.title', 'Payment session incomplete'),\n description: t(\n 'healthybowl.network.experts.payment.toast.checkoutIncomplete.description',\n 'Billing did not return the details needed to open checkout. Please try again.'\n ),\n variant: 'error',\n });\n return;\n }\n\n const Razorpay = await loadRazorpay();\n let settleRequested = false;\n const settleOnce = () => {\n if (settleRequested) return;\n settleRequested = true;\n // Razorpay does not await event callbacks. Handle the promise explicitly so an unexpected\n // settlement failure cannot turn into an unhandled rejection.\n void settleConsultationPayment(consultation).catch((err: unknown) => {\n toast({\n title: t('healthybowl.network.experts.payment.toast.syncError.title', 'Could not confirm the payment'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n });\n };\n\n const widget = new Razorpay({\n key: checkout.razorpayKeyId,\n order_id: checkout.providerOrderId,\n // Razorpay takes paise (the smallest INR unit), not whole rupees.\n amount: Math.round(checkout.total * 100),\n currency: checkout.currency,\n name: 'HealthyBowl',\n description: t('healthybowl.network.experts.payment.checkoutDescription', 'Consultation: {{topic}}', {\n topic: consultation.topic,\n }),\n // The provider response is not trusted. Both paths ask the backend to settle against billing.\n handler: settleOnce,\n modal: { ondismiss: settleOnce },\n });\n widget.open();\n widgetOpened = true;\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.payment.toast.checkoutError.title', 'Could not start the payment'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n } finally {\n // The open widget clears this via settleOnce. Every early-return or error path clears it here.\n if (!widgetOpened) {\n finishConsultationPayment(consultation.id);\n }\n }\n };\n\n // Close sort dropdown on outside click\n useEffect(() => {\n const handleClick = (e: MouseEvent) => {\n if (sortRef.current && !sortRef.current.contains(e.target as Node)) {\n setShowSortDropdown(false);\n }\n };\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, []);\n\n // Filter and sort\n const filtered = experts\n .filter((e) => {\n const matchSearch =\n (e.name ?? '').toLowerCase().includes(search.toLowerCase()) ||\n e.specialization.toLowerCase().includes(search.toLowerCase()) ||\n e.location.toLowerCase().includes(search.toLowerCase());\n const matchSpec = specFilter === 'All' || e.specialization === specFilter;\n const matchAvail = availFilter === 'All' || e.availability === availFilter.toLowerCase();\n return matchSearch && matchSpec && matchAvail;\n })\n .sort((a, b) => {\n switch (sort) {\n case 'rating':\n return b.rating - a.rating;\n case 'experience':\n return b.experience - a.experience;\n case 'price-asc':\n return a.hourlyRate - b.hourlyRate;\n case 'price-desc':\n return b.hourlyRate - a.hourlyRate;\n default:\n return 0;\n }\n });\n\n const availableCount = experts.filter((e) => e.availability === 'available').length;\n const avgRating =\n experts.length > 0 ? (experts.reduce((sum, e) => sum + e.rating, 0) / experts.length).toFixed(1) : '0.0';\n const uniqueSpecs = new Set(experts.map((e) => e.specialization)).size;\n\n return (\n <PageLayout\n title={t('healthybowl.network.experts.title', 'Expert Directory')}\n description={t('healthybowl.network.experts.description', 'Find and connect with agricultural experts')}\n purpose=\"Find agricultural specialists — agronomists, vets, soil scientists — and reach out for help. When you hit a problem outside your experience, this directory connects you with someone who knows the answer.\"\n actions={\n <Button onClick={openCreateExpert} size=\"sm\">\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n >\n {/* Stats */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.network.experts.stats.totalExperts', 'Total Experts')}\n value={experts.length}\n icon={<Award className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.availableNow', 'Available Now')}\n value={availableCount}\n icon={<Zap className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.avgRating', 'Avg Rating')}\n value={avgRating}\n icon={<Star className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.specializations', 'Specializations')}\n value={uniqueSpecs}\n icon={<User className=\"h-4 w-4\" />}\n />\n </div>\n\n {/* Filter Bar */}\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder={t(\n 'healthybowl.network.experts.searchPlaceholder',\n 'Search experts by name, specialty, or location...'\n )}\n filters={\n <div className=\"flex flex-wrap items-center gap-2\">\n {/* Specialization filter */}\n <Select value={specFilter} onValueChange={setSpecFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {specializations.map((s) => (\n <SelectItem key={s} value={s}>\n {specializationLabels[s] ?? s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Availability filter */}\n <Select value={availFilter} onValueChange={setAvailFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {availabilityOptions.map((a) => (\n <SelectItem key={a} value={a}>\n {availabilityFilterLabels[a] ?? a}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Sort dropdown */}\n <div ref={sortRef} className=\"relative\">\n <Button onClick={() => setShowSortDropdown((prev) => !prev)} variant=\"outline\" size=\"sm\">\n <ArrowUpDown className=\"h-3.5 w-3.5\" />\n {sortLabels[sort]}\n <ChevronDown className=\"h-3 w-3\" />\n </Button>\n {showSortDropdown && (\n <div className=\"absolute end-0 z-10 mt-1 w-44 rounded-md border border-border-subtle bg-bg-surface py-1 shadow-lg\">\n {sortOrder.map((key) => (\n <button\n key={key}\n type=\"button\"\n onClick={() => {\n setSort(key);\n setShowSortDropdown(false);\n }}\n className={cn(\n 'flex w-full items-center px-3 py-1.5 text-xs hover:bg-bg-sunken',\n sort === key ? 'font-semibold text-primary' : 'text-text-primary'\n )}\n >\n {sortLabels[key]}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n }\n />\n\n {/* Expert Cards */}\n {filtered.length > 0 ? (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {filtered.map((expert) => {\n const isExpanded = expandedExpert === expert.id;\n return (\n <div\n key={expert.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface p-5 transition-colors hover:border-primary/20\"\n >\n {/* Header */}\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-sm font-bold text-text-primary\">\n {(expert.name ?? '')\n .split(' ')\n .map((n) => n[0])\n .join('')}\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"text-sm font-semibold text-text-primary\">{expert.name}</h3>\n <p className=\"text-xs text-text-secondary\">{expert.specialization}</p>\n </div>\n <StatusBadge\n label={availabilityDisplayLabels[expert.availability] ?? expert.availability}\n variant={availabilityVariant(expert.availability)}\n dot\n />\n </div>\n\n {/* Info */}\n <div className=\"mt-3 space-y-1.5 text-xs text-text-secondary\">\n <p className=\"flex items-center gap-1.5\">\n <Clock className=\"h-3 w-3\" />{' '}\n {t('healthybowl.network.experts.card.yearsExperience', '{{count}} years experience', {\n count: expert.experience,\n })}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <MapPin className=\"h-3 w-3\" /> {expert.location}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <Globe className=\"h-3 w-3\" /> {(expert.languages ?? []).join(', ')}\n </p>\n </div>\n\n {/* Rating */}\n <div className=\"mt-3 flex items-center gap-1\">\n {renderStars(expert.rating)}\n <span className=\"ms-1 text-xs font-medium text-text-primary\">{expert.rating}</span>\n <span className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.card.reviews', '({{count}} reviews)', { count: expert.reviews })}\n </span>\n </div>\n\n {/* Expanded Profile */}\n {isExpanded && (\n <div className=\"mt-3 rounded-md border border-border-subtle bg-bg-sunken/50 p-3\">\n <h4 className=\"text-xs font-semibold text-text-primary\">\n {t('healthybowl.network.experts.card.about', 'About')}\n </h4>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t(\n 'healthybowl.network.experts.card.aboutText',\n '{{name}} is a seasoned agricultural expert specializing in {{specialization}} with {{count}} years of field and research experience. Known for practical, evidence-based consulting that delivers measurable results.',\n {\n name: expert.name,\n specialization: (expert.specialization ?? '').toLowerCase(),\n count: expert.experience,\n }\n )}\n </p>\n <div className=\"mt-2 grid grid-cols-2 gap-2 text-xs\">\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pastConsultations', 'Past Consultations')}\n </p>\n <p className=\"text-text-secondary\">{expert.reviews * 3}+</p>\n </div>\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.avgResponse', 'Avg Response')}\n </p>\n <p className=\"text-text-secondary\">\n {t('healthybowl.network.experts.card.avgResponseValue', '< 2 hours')}\n </p>\n </div>\n </div>\n </div>\n )}\n\n {/* Footer */}\n <div className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-3\">\n <span className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pricePerHour', '{{price}}/hr', {\n price: formatCurrency(expert.hourlyRate, HB_DEFAULT_CURRENCY),\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => setExpandedExpert(isExpanded ? null : expert.id)}\n aria-label={t('healthybowl.network.experts.actions.viewProfile', 'View profile')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Eye className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => openEditExpert(expert)}\n aria-label={t('healthybowl.network.experts.actions.editExpert', 'Edit expert')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Pencil className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => handleDeleteExpert(expert)}\n disabled={deletingId === expert.id}\n aria-label={t('healthybowl.network.experts.actions.deleteExpert', 'Delete expert')}\n variant=\"ghost\"\n size=\"icon-sm\"\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n <Button onClick={() => openBooking(expert)} size=\"sm\">\n <CalendarCheck className=\"h-3.5 w-3.5\" />{' '}\n {t('healthybowl.network.experts.actions.bookConsultation', 'Book Consultation')}\n </Button>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n ) : experts.length === 0 ? (\n loadings.network ? (\n <PageLoader />\n ) : errors.network ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <EmptyState\n illustration=\"empty-people\"\n title={t('healthybowl.network.experts.emptyState.none.title', 'No experts available yet')}\n description={t(\n 'healthybowl.network.experts.emptyState.none.description',\n 'There are no agricultural experts in your network yet. Add one to get started.'\n )}\n action={\n <Button onClick={openCreateExpert}>\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n />\n )\n ) : (\n <EmptyState\n illustration=\"empty-search\"\n title={t('healthybowl.network.experts.emptyState.noMatch.title', 'No experts found')}\n description={t(\n 'healthybowl.network.experts.emptyState.noMatch.description',\n 'No experts match your current filters. Try broadening your search.'\n )}\n action={\n <Button\n onClick={() => {\n setSearch('');\n setSpecFilter('All');\n setAvailFilter('All');\n }}\n >\n {t('healthybowl.network.experts.actions.clearFilters', 'Clear Filters')}\n </Button>\n }\n />\n )}\n\n {/* My bookings */}\n {expertConsultations.length > 0 && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <CalendarCheck className=\"h-4 w-4\" />{' '}\n {t('healthybowl.network.experts.myConsultations.heading', 'My Expert Consultations')}\n </h3>\n <ul className=\"mt-3 divide-y divide-border\">\n {expertConsultations.map((c) => (\n <li key={c.id} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{c.topic}</p>\n <p className=\"text-xs text-text-secondary\">\n {c.consultantName} · {formatDateOnly(c.requestedDate)} ·{' '}\n {consultationModeLabels[c.mode] ?? c.mode}\n </p>\n {c.fee > 0 && c.paymentStatus === 'PAID' && c.paymentReference && (\n <p className=\"truncate text-xs text-text-secondary\">\n {t('healthybowl.network.experts.payment.reference', 'Payment reference: {{reference}}', {\n reference: c.paymentReference,\n })}\n </p>\n )}\n </div>\n <div className=\"flex flex-shrink-0 items-center gap-2\">\n {c.fee > 0 &&\n c.paymentStatus === 'PENDING' &&\n (c.status === 'REQUESTED' || c.status === 'CONFIRMED') && (\n <Button\n size=\"sm\"\n onClick={() => void handlePayNow(c)}\n disabled={payingIds.has(c.id) || updatingStatusId === c.id}\n >\n <Wallet className=\"h-3.5 w-3.5\" />{' '}\n {payingIds.has(c.id)\n ? t('healthybowl.network.experts.actions.paying', 'Opening checkout…')\n : t('healthybowl.network.experts.actions.payNow', 'Pay Now')}\n </Button>\n )}\n {c.status === 'REQUESTED' && (\n <>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => handleUpdateStatus(c.id, 'CONFIRMED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.accept', 'Accept')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => handleUpdateStatus(c.id, 'CANCELLED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.decline', 'Decline')}\n </Button>\n </>\n )}\n {c.status === 'CONFIRMED' && (\n <>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => handleUpdateStatus(c.id, 'COMPLETED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.complete', 'Complete')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => handleUpdateStatus(c.id, 'CANCELLED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.cancel', 'Cancel')}\n </Button>\n </>\n )}\n <StatusBadge\n label={consultationStatusLabels[c.status] ?? c.status}\n variant={consultationStatusVariant(c.status)}\n dot\n />\n {/*\n ★ `c.paymentStatus` is part of the condition, not just read inside it. The\n consultation queries no longer select the payment fields (BOFF-6030's backend is\n not deployed — see types/index.ts), so it is undefined on every row today and\n this badge simply does not render. Rendering it anyway would have produced an\n empty badge from `labels[undefined] ?? undefined`, which looks like a styling bug\n rather than an absent feature. The same absence disables the Pay-now button above,\n which is already gated on `paymentStatus === 'PENDING'`.\n */}\n {c.fee > 0 && c.status !== 'CANCELLED' && c.paymentStatus && (\n <StatusBadge\n label={consultationPaymentStatusLabels[c.paymentStatus] ?? c.paymentStatus}\n variant={consultationPaymentVariant(c.paymentStatus)}\n />\n )}\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Booking Modal */}\n <Modal\n open={bookingExpert !== null}\n onClose={closeBooking}\n title={t('healthybowl.network.experts.bookingModal.title', 'Book Consultation')}\n description={\n bookingExpert\n ? t('healthybowl.network.experts.bookingModal.description', 'Request a session with {{name}}', {\n name: bookingExpert.name,\n })\n : undefined\n }\n footer={\n <>\n <Button onClick={closeBooking} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleBookConsultation} disabled={submitting}>\n {submitting\n ? t('healthybowl.network.experts.bookingModal.booking', 'Booking…')\n : t('healthybowl.network.experts.bookingModal.confirm', 'Confirm Booking')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"expert-booking-topic\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.topic.label', 'Topic')}\n </label>\n <input\n id=\"expert-booking-topic\"\n type=\"text\"\n value={bookingForm.topic}\n onChange={(e) => updateBookingForm('topic', e.target.value)}\n maxLength={200}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.topic.placeholder',\n 'What would you like help with?'\n )}\n className=\"w-full rounded-md 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 </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-booking-date\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.preferredDate.label', 'Preferred date')}\n </label>\n <input\n id=\"expert-booking-date\"\n type=\"date\"\n value={bookingForm.requestedDate}\n onChange={(e) => updateBookingForm('requestedDate', e.target.value)}\n min={todayLocalDate()}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-booking-mode\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.mode.label', 'Mode')}\n </label>\n <Select value={bookingForm.mode} onValueChange={(value) => updateBookingForm('mode', value)}>\n <SelectTrigger id=\"expert-booking-mode\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {consultationModes.map((m) => (\n <SelectItem key={m.value} value={m.value}>\n {m.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-booking-notes\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.notes.label', 'Notes (optional)')}\n </label>\n <textarea\n id=\"expert-booking-notes\"\n value={bookingForm.notes}\n onChange={(e) => updateBookingForm('notes', e.target.value)}\n rows={3}\n maxLength={1000}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.notes.placeholder',\n 'Any additional context for the expert'\n )}\n className=\"w-full rounded-md 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 </div>\n {bookingExpert &&\n (bookingExpert.hourlyRate > 0 ? (\n <div className=\"space-y-1 text-xs text-text-secondary\">\n <p>\n {t('healthybowl.network.experts.bookingModal.fee', 'One-hour consultation fee, payable on booking:')}{' '}\n <span className=\"font-medium text-text-primary\">\n {formatCurrency(bookingExpert.hourlyRate, HB_DEFAULT_CURRENCY)}\n </span>\n </p>\n <p>\n {t(\n 'healthybowl.network.experts.bookingModal.payoutNote',\n 'Your payment is collected by the farm. Settlement with the expert is arranged separately.'\n )}\n </p>\n </div>\n ) : (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.bookingModal.noFee', 'No fee for this consultation.')}\n </p>\n ))}\n </div>\n </Modal>\n\n {/* Add / Edit Expert Modal */}\n <Modal\n open={showExpertModal}\n onClose={closeExpertModal}\n title={\n editingExpert\n ? t('healthybowl.network.experts.form.editTitle', 'Edit Expert')\n : t('healthybowl.network.experts.form.addTitle', 'Add Expert')\n }\n description={t('healthybowl.network.experts.form.description', 'Manage an expert in your network directory')}\n size=\"lg\"\n footer={\n <>\n <Button onClick={closeExpertModal} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSaveExpert} disabled={savingExpert}>\n {savingExpert\n ? t('healthybowl.network.experts.form.saving', 'Saving…')\n : t('healthybowl.network.experts.form.save', 'Save Expert')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-name\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.name.label', 'Name')}\n </label>\n <input\n id=\"expert-form-name\"\n type=\"text\"\n value={expertForm.name}\n onChange={(e) => updateExpertForm('name', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.name.placeholder', 'Full name')}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-specialization\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.specialization.label', 'Specialization')}\n </label>\n <input\n id=\"expert-form-specialization\"\n type=\"text\"\n value={expertForm.specialization}\n onChange={(e) => updateExpertForm('specialization', e.target.value)}\n maxLength={120}\n placeholder={t(\n 'healthybowl.network.experts.form.fields.specialization.placeholder',\n 'e.g. Soil Science & Fertility'\n )}\n className=\"w-full rounded-md 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 </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"expert-form-experience\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.experience.label', 'Experience (years)')}\n </label>\n <input\n id=\"expert-form-experience\"\n type=\"number\"\n min={0}\n value={expertForm.experience}\n onChange={(e) => updateExpertForm('experience', e.target.value)}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-rating\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.rating.label', 'Rating')}\n </label>\n <input\n id=\"expert-form-rating\"\n type=\"number\"\n min={0}\n max={5}\n step={0.1}\n value={expertForm.rating}\n onChange={(e) => updateExpertForm('rating', e.target.value)}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-rate\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.hourlyRate.label', 'Hourly rate')}\n </label>\n <input\n id=\"expert-form-rate\"\n type=\"number\"\n min={0}\n step={0.01}\n value={expertForm.hourlyRate}\n onChange={(e) => updateExpertForm('hourlyRate', e.target.value)}\n className=\"w-full rounded-md 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 </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-location\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.location.label', 'Location')}\n </label>\n <input\n id=\"expert-form-location\"\n type=\"text\"\n value={expertForm.location}\n onChange={(e) => updateExpertForm('location', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.location.placeholder', 'City, Region')}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-availability\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.availability.label', 'Availability')}\n </label>\n <Select\n value={expertForm.availability}\n onValueChange={(value) => updateExpertForm('availability', value as ExpertFormState['availability'])}\n >\n <SelectTrigger id=\"expert-form-availability\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {expertAvailabilityOptions.map((o) => (\n <SelectItem key={o.value} value={o.value}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-form-languages\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.languages.label', 'Languages')}\n </label>\n <input\n id=\"expert-form-languages\"\n type=\"text\"\n value={expertForm.languages}\n onChange={(e) => updateExpertForm('languages', e.target.value)}\n placeholder={t('healthybowl.network.experts.form.fields.languages.placeholder', 'English, Hindi, Tamil')}\n className=\"w-full rounded-md 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 <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.network.experts.form.fields.languages.hint', 'Separate multiple languages with commas')}\n </p>\n </div>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoDA,IAAM,IAAqC;CACzC,OAAO;CACP,eAAe;CACf,MAAM;CACN,OAAO;AACT,GAaM,IAAmC;CACvC,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,cAAc;CACd,YAAY;CACZ,WAAW;AACb,GAEM,MAA6B,MAA0B;CAC3D,QAAQ,GAAR;EACE,KAAK,aACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,aACH,OAAO;EAET,SACE,OAAO;CACX;AACF,GAEM,MAA8B,MAAiC;CACnE,QAAQ,GAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,YACH,OAAO;EAET,SACE,OAAO;CACX;AACF,GAEM,KAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;AACF,GACM,KAAsB;CAAC;CAAO;CAAa;AAAM,GAGjD,KAA0B;CAAC;CAAU;CAAc;CAAa;AAAY,GAE5E,MAAuB,MAAc;CACzC,QAAQ,GAAR;EACE,KAAK,aACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAEA,SAAS,GAAY,GAAgB;CACnC,OAAO,MAAM,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAG,MACnC,kBAAC,IAAD,EAAc,WAAW,EAAG,eAAe,IAAI,KAAK,MAAM,CAAM,IAAI,8BAA8B,YAAY,EAAI,GAAvG,CAAuG,CACnH;AACH;AAEA,IAAa,UAA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AY,EAAE,OAAO,KAAK;QAC5D,WAAW;QACX,aAAa,EAAE,gEAAgE,cAAc;QAC7F,WAAU;OACX,CAAA,CACE,EAAA,CAAA,GACL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;QAAO,SAAQ;QAA2B,WAAU;kBACjD,EAAE,8DAA8D,cAAc;OAC1E,CAAA,GACP,kBAAC,GAAD;QACE,OAAO,EAAW;QAClB,gBAAgB,MAAU,EAAiB,gBAAgB,CAAwC;kBAFrG,CAIE,kBAAC,GAAD;SAAe,IAAG;SAA2B,WAAU;mBACrD,kBAAC,GAAD,CAAc,CAAA;QACD,CAAA,GACf,kBAAC,GAAD,EAAA,UACG,GAA0B,KAAK,MAC9B,kBAAC,GAAD;SAA0B,OAAO,EAAE;mBAChC,EAAE;QACO,GAFK,EAAE,KAEP,CACb,EACY,CAAA,CACT;SACL,EAAA,CAAA,CACF;;MACL,kBAAC,OAAD,EAAA,UAAA;OACE,kBAAC,SAAD;QAAO,SAAQ;QAAwB,WAAU;kBAC9C,EAAE,2DAA2D,WAAW;OACpE,CAAA;OACP,kBAAC,SAAD;QACE,IAAG;QACH,MAAK;QACL,OAAO,EAAW;QAClB,WAAW,MAAM,EAAiB,aAAa,EAAE,OAAO,KAAK;QAC7D,aAAa,EAAE,iEAAiE,uBAAuB;QACvG,WAAU;OACX,CAAA;OACD,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAE,0DAA0D,yCAAyC;OACrG,CAAA;MACA,EAAA,CAAA;KACF;;GACA,CAAA;GAEP,kBAAC,IAAD;IAAwB;IAAQ,WAAW;GAAU,CAAA;EAC3C;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"ExpertsPage.js","names":[],"sources":["../../../../src/healthybowl/pages/network/ExpertsPage.tsx"],"sourcesContent":["import { useState, useRef, useEffect, type FC } from 'react';\nimport {\n Star,\n MapPin,\n Clock,\n Globe,\n Award,\n ArrowUpDown,\n ChevronDown,\n Eye,\n User,\n Zap,\n CalendarCheck,\n Plus,\n Pencil,\n Trash2,\n Wallet,\n} from 'lucide-react';\nimport {\n PageLayout,\n StatCard,\n FilterBar,\n StatusBadge,\n EmptyState,\n ErrorState,\n PageLoader,\n Modal,\n} from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useToast } from '../../hooks/useToast';\nimport { useConsultationPayments } from '../../hooks/useConsultationPayments';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport type {\n Consultation,\n ConsultationPaymentStatus,\n ConsultationStatus,\n ConsultationMode,\n Expert,\n} from '../../types';\nimport { cn, formatCurrency, HB_DEFAULT_CURRENCY, formatDateOnly, todayLocalDate } from '../../utils/helpers';\n\ntype BookingFormState = {\n topic: string;\n requestedDate: string;\n mode: string;\n notes: string;\n};\n\n// Video consultations are not yet wired to a live provider, so default to\n// phone and do not offer video as a bookable mode until BOFF-4719 is built.\nconst emptyBookingForm: BookingFormState = {\n topic: '',\n requestedDate: '',\n mode: 'phone',\n notes: '',\n};\n\ntype ExpertFormState = {\n name: string;\n specialization: string;\n experience: string;\n rating: string;\n location: string;\n availability: 'available' | 'busy' | 'offline';\n hourlyRate: string;\n languages: string;\n};\n\nconst emptyExpertForm: ExpertFormState = {\n name: '',\n specialization: '',\n experience: '',\n rating: '',\n location: '',\n availability: 'available',\n hourlyRate: '',\n languages: '',\n};\n\nconst consultationStatusVariant = (s: ConsultationStatus) => {\n switch (s) {\n case 'CONFIRMED':\n return 'success' as const;\n case 'COMPLETED':\n return 'info' as const;\n case 'CANCELLED':\n return 'muted' as const;\n case 'REQUESTED':\n default:\n return 'warning' as const;\n }\n};\n\nconst consultationPaymentVariant = (s: ConsultationPaymentStatus) => {\n switch (s) {\n case 'PAID':\n return 'success' as const;\n case 'REFUNDED':\n return 'error' as const;\n case 'PENDING':\n default:\n return 'warning' as const;\n }\n};\n\nconst specializations = [\n 'All',\n 'Organic Crop Science',\n 'Integrated Pest Management',\n 'Soil Science & Fertility',\n 'Livestock & Veterinary',\n 'Organic Certification',\n];\nconst availabilityOptions = ['All', 'Available', 'Busy'];\n\ntype SortOption = 'rating' | 'experience' | 'price-asc' | 'price-desc';\nconst sortOrder: SortOption[] = ['rating', 'experience', 'price-asc', 'price-desc'];\n\nconst availabilityVariant = (a: string) => {\n switch (a) {\n case 'available':\n return 'success' as const;\n case 'busy':\n return 'warning' as const;\n case 'offline':\n return 'muted' as const;\n default:\n return 'default' as const;\n }\n};\n\nfunction renderStars(rating: number) {\n return Array.from({ length: 5 }, (_, i) => (\n <Star key={i} className={cn('h-3.5 w-3.5', i < Math.round(rating) ? 'fill-warning text-warning' : 'text-muted')} />\n ));\n}\n\nexport const ExpertsPage: FC = () => {\n const { t } = useI18n();\n const {\n experts,\n consultations,\n createConsultation,\n updateConsultationStatus,\n createExpert,\n updateExpert,\n deleteExpert,\n errors,\n loadings,\n refetch,\n } = useHealthyBowlData();\n const { checkoutConsultation, syncConsultationPayment, loadRazorpay } = useConsultationPayments();\n\n // Video mode is intentionally omitted from the booking dropdown until the\n // video provider integration is implemented (BOFF-4719). Existing video\n // requests are still displayed with the \"coming soon\" label below.\n const consultationModes = [\n { value: 'phone', label: t('healthybowl.network.experts.modes.phone', 'Phone call') },\n { value: 'in_person', label: t('healthybowl.network.experts.modes.inPerson', 'In person') },\n ];\n\n const sortLabels: Record<SortOption, string> = {\n rating: t('healthybowl.network.experts.sort.rating', 'Rating'),\n experience: t('healthybowl.network.experts.sort.experience', 'Experience'),\n 'price-asc': t('healthybowl.network.experts.sort.priceAsc', 'Price: Low → High'),\n 'price-desc': t('healthybowl.network.experts.sort.priceDesc', 'Price: High → Low'),\n };\n\n const specializationLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n 'Organic Crop Science': t('healthybowl.network.experts.specializations.organicCropScience', 'Organic Crop Science'),\n 'Integrated Pest Management': t(\n 'healthybowl.network.experts.specializations.integratedPestManagement',\n 'Integrated Pest Management'\n ),\n 'Soil Science & Fertility': t(\n 'healthybowl.network.experts.specializations.soilScienceFertility',\n 'Soil Science & Fertility'\n ),\n 'Livestock & Veterinary': t(\n 'healthybowl.network.experts.specializations.livestockVeterinary',\n 'Livestock & Veterinary'\n ),\n 'Organic Certification': t(\n 'healthybowl.network.experts.specializations.organicCertification',\n 'Organic Certification'\n ),\n };\n\n const availabilityFilterLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n Available: t('healthybowl.network.experts.availabilityFilter.available', 'Available'),\n Busy: t('healthybowl.network.experts.availabilityFilter.busy', 'Busy'),\n };\n\n const availabilityDisplayLabels: Record<string, string> = {\n available: t('healthybowl.network.experts.availability.available', 'available'),\n busy: t('healthybowl.network.experts.availability.busy', 'busy'),\n offline: t('healthybowl.network.experts.availability.offline', 'offline'),\n };\n\n const consultationStatusLabels: Record<ConsultationStatus, string> = {\n REQUESTED: t('healthybowl.network.experts.consultationStatus.requested', 'REQUESTED'),\n CONFIRMED: t('healthybowl.network.experts.consultationStatus.confirmed', 'CONFIRMED'),\n COMPLETED: t('healthybowl.network.experts.consultationStatus.completed', 'COMPLETED'),\n CANCELLED: t('healthybowl.network.experts.consultationStatus.cancelled', 'CANCELLED'),\n };\n\n const consultationPaymentStatusLabels: Record<ConsultationPaymentStatus, string> = {\n PENDING: t('healthybowl.network.experts.paymentStatus.pending', 'Payment pending'),\n PAID: t('healthybowl.network.experts.paymentStatus.paid', 'Paid'),\n REFUNDED: t('healthybowl.network.experts.paymentStatus.refunded', 'Refunded'),\n };\n\n const consultationModeLabels: Record<string, string> = {\n video: t('healthybowl.network.experts.modes.video', 'Video call (coming soon)'),\n phone: t('healthybowl.network.experts.modes.phone', 'Phone call'),\n in_person: t('healthybowl.network.experts.modes.inPerson', 'In person'),\n };\n\n const [search, setSearch] = useState('');\n const [specFilter, setSpecFilter] = useState('All');\n const [availFilter, setAvailFilter] = useState('All');\n const [sort, setSort] = useState<SortOption>('rating');\n const [showSortDropdown, setShowSortDropdown] = useState(false);\n const [expandedExpert, setExpandedExpert] = useState<string | null>(null);\n const [bookingExpert, setBookingExpert] = useState<Expert | null>(null);\n const [bookingForm, setBookingForm] = useState<BookingFormState>(emptyBookingForm);\n const [submitting, setSubmitting] = useState(false);\n\n const [showExpertModal, setShowExpertModal] = useState(false);\n const [editingExpert, setEditingExpert] = useState<Expert | null>(null);\n const [expertForm, setExpertForm] = useState<ExpertFormState>(emptyExpertForm);\n const [savingExpert, setSavingExpert] = useState(false);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [updatingStatusId, setUpdatingStatusId] = useState<string | null>(null);\n // Several consultations can be paid concurrently; model each widget rather than letting one\n // checkout clobber another card's loading state. The ref closes the same-render double-click\n // window before React has committed the button's disabled state.\n const [payingIds, setPayingIds] = useState<ReadonlySet<string>>(() => new Set());\n const payingIdsRef = useRef(new Set<string>());\n\n const beginConsultationPayment = (consultationId: string): boolean => {\n if (payingIdsRef.current.has(consultationId)) return false;\n payingIdsRef.current.add(consultationId);\n setPayingIds(new Set(payingIdsRef.current));\n return true;\n };\n\n const finishConsultationPayment = (consultationId: string): void => {\n payingIdsRef.current.delete(consultationId);\n setPayingIds(new Set(payingIdsRef.current));\n };\n\n const expertAvailabilityOptions: { value: ExpertFormState['availability']; label: string }[] = [\n { value: 'available', label: t('healthybowl.network.experts.availability.available', 'available') },\n { value: 'busy', label: t('healthybowl.network.experts.availability.busy', 'busy') },\n { value: 'offline', label: t('healthybowl.network.experts.availability.offline', 'offline') },\n ];\n\n const sortRef = useRef<HTMLDivElement>(null);\n const { toasts, toast, dismiss } = useToast();\n\n const expertConsultations = consultations.filter((c) => c.consultantType === 'EXPERT');\n\n const updateBookingForm = <K extends keyof BookingFormState>(key: K, value: BookingFormState[K]) =>\n setBookingForm((prev) => ({ ...prev, [key]: value }));\n\n const openBooking = (expert: Expert) => {\n setBookingForm(emptyBookingForm);\n setBookingExpert(expert);\n };\n\n const closeBooking = () => {\n setBookingExpert(null);\n setBookingForm(emptyBookingForm);\n };\n\n const updateExpertForm = <K extends keyof ExpertFormState>(key: K, value: ExpertFormState[K]) =>\n setExpertForm((prev) => ({ ...prev, [key]: value }));\n\n const openCreateExpert = () => {\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n setShowExpertModal(true);\n };\n\n const openEditExpert = (expert: Expert) => {\n setEditingExpert(expert);\n setExpertForm({\n name: expert.name,\n specialization: expert.specialization,\n experience: String(expert.experience),\n rating: String(expert.rating),\n location: expert.location,\n availability: expert.availability,\n hourlyRate: String(expert.hourlyRate),\n languages: (expert.languages ?? []).join(', '),\n });\n setShowExpertModal(true);\n };\n\n const closeExpertModal = () => {\n setShowExpertModal(false);\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n };\n\n const handleSaveExpert = async () => {\n if (!expertForm.name.trim() || !expertForm.specialization.trim() || !expertForm.location.trim()) {\n toast({\n title: t('healthybowl.network.experts.form.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.form.toast.missingFields.description',\n 'Name, specialization, and location are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n const languages = expertForm.languages\n .split(',')\n .map((l) => l.trim())\n .filter((l) => l.length > 0);\n setSavingExpert(true);\n try {\n if (editingExpert) {\n await updateExpert({\n id: editingExpert.id,\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.updated.title', 'Expert updated'),\n description: t('healthybowl.network.experts.form.toast.updated.description', '{{name}} has been updated.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n } else {\n await createExpert({\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.created.title', 'Expert added'),\n description: t('healthybowl.network.experts.form.toast.created.description', '{{name}} has been added.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n }\n closeExpertModal();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.saveError.title', 'Could not save expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.saveError.description', 'Failed to save expert'),\n variant: 'error',\n });\n } finally {\n setSavingExpert(false);\n }\n };\n\n const handleDeleteExpert = async (expert: Expert) => {\n setDeletingId(expert.id);\n try {\n await deleteExpert(expert.id);\n toast({\n title: t('healthybowl.network.experts.form.toast.deleted.title', 'Expert removed'),\n description: t('healthybowl.network.experts.form.toast.deleted.description', '{{name}} has been removed.', {\n name: expert.name,\n }),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.deleteError.title', 'Could not remove expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.deleteError.description', 'Failed to remove expert'),\n variant: 'error',\n });\n } finally {\n setDeletingId(null);\n }\n };\n\n const handleBookConsultation = async () => {\n if (!bookingExpert) return;\n if (!bookingForm.topic.trim() || !bookingForm.requestedDate) {\n toast({\n title: t('healthybowl.network.experts.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.toast.missingFields.description',\n 'Topic and preferred date are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n setSubmitting(true);\n try {\n await createConsultation({\n consultantType: 'EXPERT',\n consultantId: bookingExpert.id,\n consultantName: bookingExpert.name,\n topic: bookingForm.topic.trim(),\n requestedDate: bookingForm.requestedDate,\n // The mode <select> only offers the three ConsultationMode values.\n mode: bookingForm.mode as ConsultationMode,\n notes: bookingForm.notes.trim() || undefined,\n fee: bookingExpert.hourlyRate,\n });\n toast({\n title: t('healthybowl.network.experts.toast.requested.title', 'Consultation requested'),\n description: t(\n 'healthybowl.network.experts.toast.requested.description',\n 'Your request to {{name}} has been sent.',\n { name: bookingExpert.name }\n ),\n variant: 'success',\n });\n closeBooking();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.toast.bookFailed.title', 'Could not book consultation'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.toast.bookFailed.description', 'Failed to book consultation'),\n variant: 'error',\n });\n } finally {\n setSubmitting(false);\n }\n };\n\n const handleUpdateStatus = async (id: string, status: ConsultationStatus) => {\n setUpdatingStatusId(id);\n try {\n await updateConsultationStatus({ id, status });\n toast({\n title: t('healthybowl.network.experts.toast.statusUpdated.title', 'Status updated'),\n description: t(\n 'healthybowl.network.experts.toast.statusUpdated.description',\n 'The consultation has been moved to {{status}}.',\n { status: consultationStatusLabels[status] ?? status }\n ),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.toast.statusUpdateError.title', 'Could not update status'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.toast.statusUpdateError.description', 'Failed to update status'),\n variant: 'error',\n });\n } finally {\n setUpdatingStatusId(null);\n }\n };\n\n /** Settle only through the server, which re-reads the authoritative platform-billing Payment. */\n const settleConsultationPayment = async (consultation: Consultation) => {\n try {\n const settled = await syncConsultationPayment(consultation.id);\n // The settlement result is authoritative; a failed list refresh must not make a confirmed\n // payment look like a failure.\n await refetch().catch(() => undefined);\n\n if (settled.paymentStatus === 'PAID') {\n toast({\n title: t('healthybowl.network.experts.payment.toast.paid.title', 'Payment confirmed'),\n description: settled.paymentReference\n ? t(\n 'healthybowl.network.experts.payment.toast.paid.withReference',\n 'Your consultation payment is confirmed — reference {{reference}}.',\n { reference: settled.paymentReference }\n )\n : t(\n 'healthybowl.network.experts.payment.toast.paid.description',\n 'Your consultation payment is confirmed.'\n ),\n variant: 'success',\n });\n } else {\n toast({\n title: t('healthybowl.network.experts.payment.toast.pending.title', 'Payment not completed'),\n description: t(\n 'healthybowl.network.experts.payment.toast.pending.description',\n 'This consultation is still awaiting payment. Nothing was charged — you can pay again any time.'\n ),\n variant: 'info',\n });\n }\n } finally {\n finishConsultationPayment(consultation.id);\n }\n };\n\n /**\n * Opens Razorpay using billing's runtime checkout details. Razorpay may call both `handler` and\n * `ondismiss` after a successful payment, so both routes share the one-shot settlement guard.\n */\n const handlePayNow = async (consultation: Consultation) => {\n if (!beginConsultationPayment(consultation.id)) return;\n let widgetOpened = false;\n\n try {\n const checkout = await checkoutConsultation(consultation.id);\n if (checkout.provider !== 'RAZORPAY') {\n toast({\n title: t(\n 'healthybowl.network.experts.payment.toast.unsupportedProvider.title',\n 'Unsupported payment provider'\n ),\n description: t(\n 'healthybowl.network.experts.payment.toast.unsupportedProvider.description',\n 'Billing routed this consultation to {{provider}}, which this checkout cannot open yet. Contact support for help.',\n { provider: checkout.provider }\n ),\n variant: 'warning',\n });\n return;\n }\n if (!checkout.providerOrderId || !checkout.razorpayKeyId) {\n toast({\n title: t('healthybowl.network.experts.payment.toast.checkoutIncomplete.title', 'Payment session incomplete'),\n description: t(\n 'healthybowl.network.experts.payment.toast.checkoutIncomplete.description',\n 'Billing did not return the details needed to open checkout. Please try again.'\n ),\n variant: 'error',\n });\n return;\n }\n\n const Razorpay = await loadRazorpay();\n let settleRequested = false;\n const settleOnce = () => {\n if (settleRequested) return;\n settleRequested = true;\n // Razorpay does not await event callbacks. Handle the promise explicitly so an unexpected\n // settlement failure cannot turn into an unhandled rejection.\n void settleConsultationPayment(consultation).catch((err: unknown) => {\n toast({\n title: t('healthybowl.network.experts.payment.toast.syncError.title', 'Could not confirm the payment'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n });\n };\n\n const widget = new Razorpay({\n key: checkout.razorpayKeyId,\n order_id: checkout.providerOrderId,\n // Razorpay takes paise (the smallest INR unit), not whole rupees.\n amount: Math.round(checkout.total * 100),\n currency: checkout.currency,\n name: 'HealthyBowl',\n description: t('healthybowl.network.experts.payment.checkoutDescription', 'Consultation: {{topic}}', {\n topic: consultation.topic,\n }),\n // The provider response is not trusted. Both paths ask the backend to settle against billing.\n handler: settleOnce,\n modal: { ondismiss: settleOnce },\n });\n widget.open();\n widgetOpened = true;\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.payment.toast.checkoutError.title', 'Could not start the payment'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n } finally {\n // The open widget clears this via settleOnce. Every early-return or error path clears it here.\n if (!widgetOpened) {\n finishConsultationPayment(consultation.id);\n }\n }\n };\n\n // Close sort dropdown on outside click\n useEffect(() => {\n const handleClick = (e: MouseEvent) => {\n if (sortRef.current && !sortRef.current.contains(e.target as Node)) {\n setShowSortDropdown(false);\n }\n };\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, []);\n\n // Filter and sort\n const filtered = experts\n .filter((e) => {\n const matchSearch =\n (e.name ?? '').toLowerCase().includes(search.toLowerCase()) ||\n e.specialization.toLowerCase().includes(search.toLowerCase()) ||\n e.location.toLowerCase().includes(search.toLowerCase());\n const matchSpec = specFilter === 'All' || e.specialization === specFilter;\n const matchAvail = availFilter === 'All' || e.availability === availFilter.toLowerCase();\n return matchSearch && matchSpec && matchAvail;\n })\n .sort((a, b) => {\n switch (sort) {\n case 'rating':\n return b.rating - a.rating;\n case 'experience':\n return b.experience - a.experience;\n case 'price-asc':\n return a.hourlyRate - b.hourlyRate;\n case 'price-desc':\n return b.hourlyRate - a.hourlyRate;\n default:\n return 0;\n }\n });\n\n const availableCount = experts.filter((e) => e.availability === 'available').length;\n const avgRating =\n experts.length > 0 ? (experts.reduce((sum, e) => sum + e.rating, 0) / experts.length).toFixed(1) : '0.0';\n const uniqueSpecs = new Set(experts.map((e) => e.specialization)).size;\n\n return (\n <PageLayout\n title={t('healthybowl.network.experts.title', 'Expert Directory')}\n description={t('healthybowl.network.experts.description', 'Find and connect with agricultural experts')}\n purpose=\"Find agricultural specialists — agronomists, vets, soil scientists — and reach out for help. When you hit a problem outside your experience, this directory connects you with someone who knows the answer.\"\n actions={\n <Button onClick={openCreateExpert} size=\"sm\">\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n >\n {/* Stats */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.network.experts.stats.totalExperts', 'Total Experts')}\n value={experts.length}\n icon={<Award className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.availableNow', 'Available Now')}\n value={availableCount}\n icon={<Zap className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.avgRating', 'Avg Rating')}\n value={avgRating}\n icon={<Star className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.specializations', 'Specializations')}\n value={uniqueSpecs}\n icon={<User className=\"h-4 w-4\" />}\n />\n </div>\n\n {/* Filter Bar */}\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder={t(\n 'healthybowl.network.experts.searchPlaceholder',\n 'Search experts by name, specialty, or location...'\n )}\n filters={\n <div className=\"flex flex-wrap items-center gap-2\">\n {/* Specialization filter */}\n <Select value={specFilter} onValueChange={setSpecFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {specializations.map((s) => (\n <SelectItem key={s} value={s}>\n {specializationLabels[s] ?? s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Availability filter */}\n <Select value={availFilter} onValueChange={setAvailFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {availabilityOptions.map((a) => (\n <SelectItem key={a} value={a}>\n {availabilityFilterLabels[a] ?? a}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Sort dropdown */}\n <div ref={sortRef} className=\"relative\">\n <Button onClick={() => setShowSortDropdown((prev) => !prev)} variant=\"outline\" size=\"sm\">\n <ArrowUpDown className=\"h-3.5 w-3.5\" />\n {sortLabels[sort]}\n <ChevronDown className=\"h-3 w-3\" />\n </Button>\n {showSortDropdown && (\n <div className=\"absolute end-0 z-10 mt-1 w-44 rounded-md border border-border-subtle bg-bg-surface py-1 shadow-lg\">\n {sortOrder.map((key) => (\n <button\n key={key}\n type=\"button\"\n onClick={() => {\n setSort(key);\n setShowSortDropdown(false);\n }}\n className={cn(\n 'flex w-full items-center px-3 py-1.5 text-xs hover:bg-bg-sunken',\n sort === key ? 'font-semibold text-primary' : 'text-text-primary'\n )}\n >\n {sortLabels[key]}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n }\n />\n\n {/* Expert Cards */}\n {filtered.length > 0 ? (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {filtered.map((expert) => {\n const isExpanded = expandedExpert === expert.id;\n return (\n <div\n key={expert.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface p-5 transition-colors hover:border-primary/20\"\n >\n {/* Header */}\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-sm font-bold text-text-primary\">\n {(expert.name ?? '')\n .split(' ')\n .map((n) => n[0])\n .join('')}\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"text-sm font-semibold text-text-primary\">{expert.name}</h3>\n <p className=\"text-xs text-text-secondary\">{expert.specialization}</p>\n </div>\n <StatusBadge\n label={availabilityDisplayLabels[expert.availability] ?? expert.availability}\n variant={availabilityVariant(expert.availability)}\n dot\n />\n </div>\n\n {/* Info */}\n <div className=\"mt-3 space-y-1.5 text-xs text-text-secondary\">\n <p className=\"flex items-center gap-1.5\">\n <Clock className=\"h-3 w-3\" />{' '}\n {t('healthybowl.network.experts.card.yearsExperience', '{{count}} years experience', {\n count: expert.experience,\n })}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <MapPin className=\"h-3 w-3\" /> {expert.location}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <Globe className=\"h-3 w-3\" /> {(expert.languages ?? []).join(', ')}\n </p>\n </div>\n\n {/* Rating */}\n <div className=\"mt-3 flex items-center gap-1\">\n {renderStars(expert.rating)}\n <span className=\"ms-1 text-xs font-medium text-text-primary\">{expert.rating}</span>\n <span className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.card.reviews', '({{count}} reviews)', { count: expert.reviews })}\n </span>\n </div>\n\n {/* Expanded Profile */}\n {isExpanded && (\n <div className=\"mt-3 rounded-md border border-border-subtle bg-bg-sunken/50 p-3\">\n <h4 className=\"text-xs font-semibold text-text-primary\">\n {t('healthybowl.network.experts.card.about', 'About')}\n </h4>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t(\n 'healthybowl.network.experts.card.aboutText',\n '{{name}} is a seasoned agricultural expert specializing in {{specialization}} with {{count}} years of field and research experience. Known for practical, evidence-based consulting that delivers measurable results.',\n {\n name: expert.name,\n specialization: (expert.specialization ?? '').toLowerCase(),\n count: expert.experience,\n }\n )}\n </p>\n <div className=\"mt-2 grid grid-cols-2 gap-2 text-xs\">\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pastConsultations', 'Past Consultations')}\n </p>\n <p className=\"text-text-secondary\">{expert.reviews * 3}+</p>\n </div>\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.avgResponse', 'Avg Response')}\n </p>\n <p className=\"text-text-secondary\">\n {t('healthybowl.network.experts.card.avgResponseValue', '< 2 hours')}\n </p>\n </div>\n </div>\n </div>\n )}\n\n {/* Footer */}\n <div className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-3\">\n <span className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pricePerHour', '{{price}}/hr', {\n price: formatCurrency(expert.hourlyRate, HB_DEFAULT_CURRENCY),\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => setExpandedExpert(isExpanded ? null : expert.id)}\n aria-label={t('healthybowl.network.experts.actions.viewProfile', 'View profile')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Eye className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => openEditExpert(expert)}\n aria-label={t('healthybowl.network.experts.actions.editExpert', 'Edit expert')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Pencil className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => handleDeleteExpert(expert)}\n disabled={deletingId === expert.id}\n aria-label={t('healthybowl.network.experts.actions.deleteExpert', 'Delete expert')}\n variant=\"ghost\"\n size=\"icon-sm\"\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n <Button onClick={() => openBooking(expert)} size=\"sm\">\n <CalendarCheck className=\"h-3.5 w-3.5\" />{' '}\n {t('healthybowl.network.experts.actions.bookConsultation', 'Book Consultation')}\n </Button>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n ) : experts.length === 0 ? (\n loadings.network ? (\n <PageLoader />\n ) : errors.network ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <EmptyState\n illustration=\"empty-people\"\n title={t('healthybowl.network.experts.emptyState.none.title', 'No experts available yet')}\n description={t(\n 'healthybowl.network.experts.emptyState.none.description',\n 'There are no agricultural experts in your network yet. Add one to get started.'\n )}\n action={\n <Button onClick={openCreateExpert}>\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n />\n )\n ) : (\n <EmptyState\n illustration=\"empty-search\"\n title={t('healthybowl.network.experts.emptyState.noMatch.title', 'No experts found')}\n description={t(\n 'healthybowl.network.experts.emptyState.noMatch.description',\n 'No experts match your current filters. Try broadening your search.'\n )}\n action={\n <Button\n onClick={() => {\n setSearch('');\n setSpecFilter('All');\n setAvailFilter('All');\n }}\n >\n {t('healthybowl.network.experts.actions.clearFilters', 'Clear Filters')}\n </Button>\n }\n />\n )}\n\n {/* My bookings */}\n {expertConsultations.length > 0 && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <CalendarCheck className=\"h-4 w-4\" />{' '}\n {t('healthybowl.network.experts.myConsultations.heading', 'My Expert Consultations')}\n </h3>\n <ul className=\"mt-3 divide-y divide-border\">\n {expertConsultations.map((c) => (\n <li key={c.id} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{c.topic}</p>\n <p className=\"text-xs text-text-secondary\">\n {c.consultantName} · {formatDateOnly(c.requestedDate)} ·{' '}\n {consultationModeLabels[c.mode] ?? c.mode}\n </p>\n {c.fee > 0 && c.paymentStatus === 'PAID' && c.paymentReference && (\n <p className=\"truncate text-xs text-text-secondary\">\n {t('healthybowl.network.experts.payment.reference', 'Payment reference: {{reference}}', {\n reference: c.paymentReference,\n })}\n </p>\n )}\n </div>\n <div className=\"flex flex-shrink-0 items-center gap-2\">\n {c.fee > 0 &&\n c.paymentStatus === 'PENDING' &&\n (c.status === 'REQUESTED' || c.status === 'CONFIRMED') && (\n <Button\n size=\"sm\"\n onClick={() => void handlePayNow(c)}\n disabled={payingIds.has(c.id) || updatingStatusId === c.id}\n >\n <Wallet className=\"h-3.5 w-3.5\" />{' '}\n {payingIds.has(c.id)\n ? t('healthybowl.network.experts.actions.paying', 'Opening checkout…')\n : t('healthybowl.network.experts.actions.payNow', 'Pay Now')}\n </Button>\n )}\n {c.status === 'REQUESTED' && (\n <>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => handleUpdateStatus(c.id, 'CONFIRMED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.accept', 'Accept')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => handleUpdateStatus(c.id, 'CANCELLED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.decline', 'Decline')}\n </Button>\n </>\n )}\n {c.status === 'CONFIRMED' && (\n <>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => handleUpdateStatus(c.id, 'COMPLETED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.complete', 'Complete')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => handleUpdateStatus(c.id, 'CANCELLED')}\n disabled={updatingStatusId === c.id}\n >\n {t('healthybowl.network.experts.actions.cancel', 'Cancel')}\n </Button>\n </>\n )}\n <StatusBadge\n label={consultationStatusLabels[c.status] ?? c.status}\n variant={consultationStatusVariant(c.status)}\n dot\n />\n {/*\n ★ `c.paymentStatus` is part of the condition, not just read inside it. The\n consultation queries no longer select the payment fields (BOFF-6030's backend is\n not deployed — see types/index.ts), so it is undefined on every row today and\n this badge simply does not render. Rendering it anyway would have produced an\n empty badge from `labels[undefined] ?? undefined`, which looks like a styling bug\n rather than an absent feature. The same absence disables the Pay-now button above,\n which is already gated on `paymentStatus === 'PENDING'`.\n */}\n {c.fee > 0 && c.status !== 'CANCELLED' && c.paymentStatus && (\n <StatusBadge\n label={consultationPaymentStatusLabels[c.paymentStatus] ?? c.paymentStatus}\n variant={consultationPaymentVariant(c.paymentStatus)}\n />\n )}\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Booking Modal */}\n <Modal\n open={bookingExpert !== null}\n onClose={closeBooking}\n title={t('healthybowl.network.experts.bookingModal.title', 'Book Consultation')}\n description={\n bookingExpert\n ? t('healthybowl.network.experts.bookingModal.description', 'Request a session with {{name}}', {\n name: bookingExpert.name,\n })\n : undefined\n }\n footer={\n <>\n <Button onClick={closeBooking} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleBookConsultation} disabled={submitting}>\n {submitting\n ? t('healthybowl.network.experts.bookingModal.booking', 'Booking…')\n : t('healthybowl.network.experts.bookingModal.confirm', 'Confirm Booking')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"expert-booking-topic\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.topic.label', 'Topic')}\n </label>\n <input\n id=\"expert-booking-topic\"\n type=\"text\"\n value={bookingForm.topic}\n onChange={(e) => updateBookingForm('topic', e.target.value)}\n maxLength={200}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.topic.placeholder',\n 'What would you like help with?'\n )}\n className=\"w-full rounded-md 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 </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-booking-date\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.preferredDate.label', 'Preferred date')}\n </label>\n <input\n id=\"expert-booking-date\"\n type=\"date\"\n value={bookingForm.requestedDate}\n onChange={(e) => updateBookingForm('requestedDate', e.target.value)}\n min={todayLocalDate()}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-booking-mode\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.mode.label', 'Mode')}\n </label>\n <Select value={bookingForm.mode} onValueChange={(value) => updateBookingForm('mode', value)}>\n <SelectTrigger id=\"expert-booking-mode\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {consultationModes.map((m) => (\n <SelectItem key={m.value} value={m.value}>\n {m.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-booking-notes\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.notes.label', 'Notes (optional)')}\n </label>\n <textarea\n id=\"expert-booking-notes\"\n value={bookingForm.notes}\n onChange={(e) => updateBookingForm('notes', e.target.value)}\n rows={3}\n maxLength={1000}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.notes.placeholder',\n 'Any additional context for the expert'\n )}\n className=\"w-full rounded-md 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 </div>\n {bookingExpert &&\n (bookingExpert.hourlyRate > 0 ? (\n <div className=\"space-y-1 text-xs text-text-secondary\">\n <p>\n {t('healthybowl.network.experts.bookingModal.fee', 'One-hour consultation fee, payable on booking:')}{' '}\n <span className=\"font-medium text-text-primary\">\n {formatCurrency(bookingExpert.hourlyRate, HB_DEFAULT_CURRENCY)}\n </span>\n </p>\n <p>\n {t(\n 'healthybowl.network.experts.bookingModal.payoutNote',\n 'Your payment is collected by the farm. Settlement with the expert is arranged separately.'\n )}\n </p>\n </div>\n ) : (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.bookingModal.noFee', 'No fee for this consultation.')}\n </p>\n ))}\n </div>\n </Modal>\n\n {/* Add / Edit Expert Modal */}\n <Modal\n open={showExpertModal}\n onClose={closeExpertModal}\n title={\n editingExpert\n ? t('healthybowl.network.experts.form.editTitle', 'Edit Expert')\n : t('healthybowl.network.experts.form.addTitle', 'Add Expert')\n }\n description={t('healthybowl.network.experts.form.description', 'Manage an expert in your network directory')}\n size=\"lg\"\n footer={\n <>\n <Button onClick={closeExpertModal} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSaveExpert} disabled={savingExpert}>\n {savingExpert\n ? t('healthybowl.network.experts.form.saving', 'Saving…')\n : t('healthybowl.network.experts.form.save', 'Save Expert')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-name\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.name.label', 'Name')}\n </label>\n <input\n id=\"expert-form-name\"\n type=\"text\"\n value={expertForm.name}\n onChange={(e) => updateExpertForm('name', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.name.placeholder', 'Full name')}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-specialization\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.specialization.label', 'Specialization')}\n </label>\n <input\n id=\"expert-form-specialization\"\n type=\"text\"\n value={expertForm.specialization}\n onChange={(e) => updateExpertForm('specialization', e.target.value)}\n maxLength={120}\n placeholder={t(\n 'healthybowl.network.experts.form.fields.specialization.placeholder',\n 'e.g. Soil Science & Fertility'\n )}\n className=\"w-full rounded-md 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 </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"expert-form-experience\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.experience.label', 'Experience (years)')}\n </label>\n <input\n id=\"expert-form-experience\"\n type=\"number\"\n min={0}\n value={expertForm.experience}\n onChange={(e) => updateExpertForm('experience', e.target.value)}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-rating\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.rating.label', 'Rating')}\n </label>\n <input\n id=\"expert-form-rating\"\n type=\"number\"\n min={0}\n max={5}\n step={0.1}\n value={expertForm.rating}\n onChange={(e) => updateExpertForm('rating', e.target.value)}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-rate\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.hourlyRate.label', 'Hourly rate')}\n </label>\n <input\n id=\"expert-form-rate\"\n type=\"number\"\n min={0}\n step={0.01}\n value={expertForm.hourlyRate}\n onChange={(e) => updateExpertForm('hourlyRate', e.target.value)}\n className=\"w-full rounded-md 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 </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-location\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.location.label', 'Location')}\n </label>\n <input\n id=\"expert-form-location\"\n type=\"text\"\n value={expertForm.location}\n onChange={(e) => updateExpertForm('location', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.location.placeholder', 'City, Region')}\n className=\"w-full rounded-md 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 </div>\n <div>\n <label htmlFor=\"expert-form-availability\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.availability.label', 'Availability')}\n </label>\n <Select\n value={expertForm.availability}\n onValueChange={(value) => updateExpertForm('availability', value as ExpertFormState['availability'])}\n >\n <SelectTrigger id=\"expert-form-availability\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {expertAvailabilityOptions.map((o) => (\n <SelectItem key={o.value} value={o.value}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-form-languages\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.languages.label', 'Languages')}\n </label>\n <input\n id=\"expert-form-languages\"\n type=\"text\"\n value={expertForm.languages}\n onChange={(e) => updateExpertForm('languages', e.target.value)}\n placeholder={t('healthybowl.network.experts.form.fields.languages.placeholder', 'English, Hindi, Tamil')}\n className=\"w-full rounded-md 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 <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.network.experts.form.fields.languages.hint', 'Separate multiple languages with commas')}\n </p>\n </div>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoDA,IAAM,IAAqC;CACzC,OAAO;CACP,eAAe;CACf,MAAM;CACN,OAAO;AACT,GAaM,IAAmC;CACvC,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,cAAc;CACd,YAAY;CACZ,WAAW;AACb,GAEM,MAA6B,MAA0B;CAC3D,QAAQ,GAAR;EACE,KAAK,aACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,aACH,OAAO;EAET,SACE,OAAO;CACX;AACF,GAEM,MAA8B,MAAiC;CACnE,QAAQ,GAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,YACH,OAAO;EAET,SACE,OAAO;CACX;AACF,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Aa,EAAE,OAAO,KAAK;QAC7D,aAAa,EAAE,iEAAiE,uBAAuB;QACvG,WAAU;OACX,CAAA;OACD,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAE,0DAA0D,yCAAyC;OACrG,CAAA;MACA,EAAA,CAAA;KACF;;GACA,CAAA;GAEP,kBAAC,IAAD;IAAwB;IAAQ,WAAW;GAAU,CAAA;EAC3C;;AAEhB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { cn as e, formatCurrency as t, formatDate as n, formatDateOnly as r, todayLocalDate as i } from "../../utils/helpers.js";
|
|
2
2
|
import { PageLayout as a } from "../../components/PageLayout.js";
|
|
3
3
|
import { StatCard as o } from "../../components/StatCard.js";
|
|
4
|
+
import { FilterBar as ee } from "../../components/FilterBar.js";
|
|
4
5
|
import { StatusBadge as s } from "../../components/StatusBadge.js";
|
|
5
|
-
import { EmptyState as
|
|
6
|
-
import { ErrorState as
|
|
7
|
-
import { FilterBar as ne } from "../../components/FilterBar.js";
|
|
6
|
+
import { EmptyState as te } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorState as ne } from "../../components/ErrorState.js";
|
|
8
8
|
import { ToastContainer as re } from "../../components/Toast.js";
|
|
9
9
|
import { PageLoader as ie } from "../../components/PageLoader.js";
|
|
10
10
|
import { Modal as c } from "../../components/Modal.js";
|
|
@@ -360,7 +360,7 @@ var w = () => {
|
|
|
360
360
|
})
|
|
361
361
|
]
|
|
362
362
|
}),
|
|
363
|
-
/* @__PURE__ */ p(
|
|
363
|
+
/* @__PURE__ */ p(ee, {
|
|
364
364
|
searchValue: D,
|
|
365
365
|
onSearchChange: O,
|
|
366
366
|
searchPlaceholder: d("healthybowl.network.mentors.searchPlaceholder", "Search mentors by name, specialty, or focus area..."),
|
|
@@ -627,7 +627,7 @@ var w = () => {
|
|
|
627
627
|
]
|
|
628
628
|
}, r.id);
|
|
629
629
|
})
|
|
630
|
-
}) : w.length === 0 ? Ie.network ? /* @__PURE__ */ p(ie, {}) : Fe.network ? /* @__PURE__ */ p(
|
|
630
|
+
}) : w.length === 0 ? Ie.network ? /* @__PURE__ */ p(ie, {}) : Fe.network ? /* @__PURE__ */ p(ne, { onRetry: Le }) : /* @__PURE__ */ p(te, {
|
|
631
631
|
illustration: "empty-people",
|
|
632
632
|
title: d("healthybowl.network.mentors.emptyState.noMentors.title", "No mentors available yet"),
|
|
633
633
|
description: d("healthybowl.network.mentors.emptyState.noMentors.description", "There are no mentors in your network yet. Add one to get started."),
|
|
@@ -639,7 +639,7 @@ var w = () => {
|
|
|
639
639
|
d("healthybowl.network.mentors.actions.addMentor", "Add Mentor")
|
|
640
640
|
]
|
|
641
641
|
})
|
|
642
|
-
}) : /* @__PURE__ */ p(
|
|
642
|
+
}) : /* @__PURE__ */ p(te, {
|
|
643
643
|
illustration: "empty-search",
|
|
644
644
|
title: d("healthybowl.network.mentors.emptyState.noResults.title", "No mentors found"),
|
|
645
645
|
description: d("healthybowl.network.mentors.emptyState.noResults.description", "No mentors match your current filters. Try adjusting your search criteria."),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { formatDate as e } from "../../utils/helpers.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { DataTable as n } from "../../components/DataTable.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { FilterBar as r } from "../../components/FilterBar.js";
|
|
5
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
6
|
+
import { ErrorState as a } from "../../components/ErrorState.js";
|
|
7
7
|
import { ToastContainer as o } from "../../components/Toast.js";
|
|
8
8
|
import { useConfirm as s } from "../../components/ConfirmDialog.js";
|
|
9
9
|
import { PageLoader as c } from "../../components/PageLoader.js";
|
|
@@ -140,7 +140,7 @@ function A() {
|
|
|
140
140
|
{
|
|
141
141
|
key: "type",
|
|
142
142
|
header: A("healthybowl.pestManagement.pestIssues.table.headers.type", "Type"),
|
|
143
|
-
render: (e) => /* @__PURE__ */ v(
|
|
143
|
+
render: (e) => /* @__PURE__ */ v(i, {
|
|
144
144
|
label: e.type,
|
|
145
145
|
variant: O[e.type] ?? "muted"
|
|
146
146
|
})
|
|
@@ -156,7 +156,7 @@ function A() {
|
|
|
156
156
|
{
|
|
157
157
|
key: "severity",
|
|
158
158
|
header: A("healthybowl.pestManagement.pestIssues.table.headers.severity", "Severity"),
|
|
159
|
-
render: (e) => /* @__PURE__ */ v(
|
|
159
|
+
render: (e) => /* @__PURE__ */ v(i, {
|
|
160
160
|
label: e.severity,
|
|
161
161
|
variant: E[e.severity] ?? "info"
|
|
162
162
|
})
|
|
@@ -164,7 +164,7 @@ function A() {
|
|
|
164
164
|
{
|
|
165
165
|
key: "status",
|
|
166
166
|
header: A("healthybowl.pestManagement.pestIssues.table.headers.status", "Status"),
|
|
167
|
-
render: (e) => /* @__PURE__ */ v(
|
|
167
|
+
render: (e) => /* @__PURE__ */ v(i, {
|
|
168
168
|
label: e.status,
|
|
169
169
|
variant: D[e.status ?? "unknown"] ?? "info",
|
|
170
170
|
dot: !0
|
|
@@ -257,12 +257,12 @@ function A() {
|
|
|
257
257
|
]
|
|
258
258
|
}),
|
|
259
259
|
children: [
|
|
260
|
-
/* @__PURE__ */ v(
|
|
260
|
+
/* @__PURE__ */ v(r, {
|
|
261
261
|
searchValue: B,
|
|
262
262
|
onSearchChange: V,
|
|
263
263
|
searchPlaceholder: A("healthybowl.pestManagement.pestIssues.searchPlaceholder", "Search pests, crops, fields...")
|
|
264
264
|
}),
|
|
265
|
-
R.pest ? /* @__PURE__ */ v(c, {}) : z.pest ? /* @__PURE__ */ v(
|
|
265
|
+
R.pest ? /* @__PURE__ */ v(c, {}) : z.pest ? /* @__PURE__ */ v(a, { onRetry: ne }) : /* @__PURE__ */ v(n, {
|
|
266
266
|
columns: ce,
|
|
267
267
|
data: ae,
|
|
268
268
|
keyField: "id"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/helpers.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { FilterBar as n } from "../../components/FilterBar.js";
|
|
4
|
+
import { StatusBadge as ee } from "../../components/StatusBadge.js";
|
|
5
|
+
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
6
|
+
import { ErrorState as i } from "../../components/ErrorState.js";
|
|
7
7
|
import { ToastContainer as a } from "../../components/Toast.js";
|
|
8
8
|
import { useConfirm as o } from "../../components/ConfirmDialog.js";
|
|
9
9
|
import { PageLoader as s } from "../../components/PageLoader.js";
|
|
@@ -128,12 +128,12 @@ function k() {
|
|
|
128
128
|
]
|
|
129
129
|
}),
|
|
130
130
|
children: [
|
|
131
|
-
/* @__PURE__ */ y(
|
|
131
|
+
/* @__PURE__ */ y(n, {
|
|
132
132
|
searchValue: I,
|
|
133
133
|
onSearchChange: L,
|
|
134
134
|
searchPlaceholder: k("healthybowl.pestManagement.treatmentLibrary.searchPlaceholder", "Search treatments or target pests...")
|
|
135
135
|
}),
|
|
136
|
-
F.pest ? /* @__PURE__ */ y(s, {}) : P.pest ? /* @__PURE__ */ y(
|
|
136
|
+
F.pest ? /* @__PURE__ */ y(s, {}) : P.pest ? /* @__PURE__ */ y(i, { onRetry: te }) : Z.length === 0 ? /* @__PURE__ */ y(r, {
|
|
137
137
|
title: k("healthybowl.pestManagement.treatmentLibrary.emptyState.title", "No treatments found"),
|
|
138
138
|
description: k("healthybowl.pestManagement.treatmentLibrary.emptyState.description", "Pest and disease treatment options will appear here.")
|
|
139
139
|
}) : /* @__PURE__ */ y("div", {
|
|
@@ -151,7 +151,7 @@ function k() {
|
|
|
151
151
|
}), /* @__PURE__ */ b("div", {
|
|
152
152
|
className: "flex items-center gap-1.5",
|
|
153
153
|
children: [
|
|
154
|
-
/* @__PURE__ */ y(
|
|
154
|
+
/* @__PURE__ */ y(ee, {
|
|
155
155
|
label: X[t.type] ?? t.type,
|
|
156
156
|
variant: D[t.type] ?? "muted"
|
|
157
157
|
}),
|