@burdenoff/microfe-healthybowl 2026.902.21 → 2026.902.22

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.
Files changed (21) hide show
  1. package/dist/healthybowl/hooks/useHealthyBowlData.js +0 -15
  2. package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
  3. package/dist/healthybowl/offline/graphql.js.map +1 -1
  4. package/dist/healthybowl/offline/syncEngine.js +1 -2
  5. package/dist/healthybowl/offline/syncEngine.js.map +1 -1
  6. package/dist/healthybowl/offline/types.js.map +1 -1
  7. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +188 -228
  8. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
  9. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +191 -261
  10. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
  11. package/dist/healthybowl/pages/network/ExpertsPage.js +419 -520
  12. package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
  13. package/package.json +1 -1
  14. package/dist/healthybowl/hooks/useConsultationPayments.js +0 -59
  15. package/dist/healthybowl/hooks/useConsultationPayments.js.map +0 -1
  16. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +0 -49
  17. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +0 -1
  18. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +0 -48
  19. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +0 -1
  20. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +0 -54
  21. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +0 -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} &middot; {formatDateOnly(c.requestedDate)} &middot;{' '}\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 {c.fee > 0 && c.status !== 'CANCELLED' && (\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,O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AD;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} 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 { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport type { Expert, ConsultationStatus, ConsultationMode } 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 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\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 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\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 // 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} &middot; {formatDateOnly(c.requestedDate)} &middot;{' '}\n {consultationModeLabels[c.mode] ?? c.mode}\n </p>\n </div>\n <div className=\"flex flex-shrink-0 items-center gap-2\">\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 </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 <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.bookingModal.estimatedFee', 'Estimated fee:')}{' '}\n <span className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pricePerHour', '{{price}}/hr', {\n price: formatCurrency(bookingExpert.hourlyRate, HB_DEFAULT_CURRENCY),\n })}\n </span>\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":";;;;;;;;;;;;;;;;;;;AA4CA,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,KAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;AACF,GACM,KAAsB;CAAC;CAAO;CAAa;AAAM,GAGjD,KAA0B;CAAC;CAAU;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,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-healthybowl",
3
- "version": "2026.902.21",
3
+ "version": "2026.902.22",
4
4
  "description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,59 +0,0 @@
1
- import { loadRazorpayCheckout as e } from "./useOrderPayments.js";
2
- import { useCallback as t, useMemo as n } from "react";
3
- import { gql as r } from "@apollo/client";
4
- import { useMutation as i } from "@apollo/client/react";
5
- //#region src/healthybowl/hooks/useConsultationPayments.ts
6
- var a = r`
7
- mutation CheckoutHealthyBowlConsultation($consultationId: ID!, $context: ContextInput!) {
8
- checkoutHealthyBowlConsultation(consultationId: $consultationId, context: $context) {
9
- consultationId
10
- billingOrderId
11
- provider
12
- providerOrderId
13
- razorpayKeyId
14
- clientSecret
15
- subtotal
16
- taxAmount
17
- total
18
- currency
19
- }
20
- }
21
- `, o = r`
22
- mutation SyncHealthyBowlConsultationPayment($consultationId: ID!, $context: ContextInput!) {
23
- syncHealthyBowlConsultationPayment(consultationId: $consultationId, context: $context) {
24
- id
25
- status
26
- paymentStatus
27
- paymentProvider
28
- paymentReference
29
- paidAmount
30
- paidAt
31
- }
32
- }
33
- `;
34
- function s() {
35
- let r = n(() => ({}), []), [s] = i(a), [c] = i(o);
36
- return {
37
- checkoutConsultation: t(async (e) => {
38
- let t = (await s({ variables: {
39
- consultationId: e,
40
- context: r
41
- } })).data?.checkoutHealthyBowlConsultation;
42
- if (!t) throw Error("Checkout did not return a payment session");
43
- return t;
44
- }, [s, r]),
45
- syncConsultationPayment: t(async (e) => {
46
- let t = (await c({ variables: {
47
- consultationId: e,
48
- context: r
49
- } })).data?.syncHealthyBowlConsultationPayment;
50
- if (!t) throw Error("Payment sync did not return the consultation");
51
- return t;
52
- }, [r, c]),
53
- loadRazorpay: e
54
- };
55
- }
56
- //#endregion
57
- export { s as useConsultationPayments };
58
-
59
- //# sourceMappingURL=useConsultationPayments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConsultationPayments.js","names":[],"sources":["../../../src/healthybowl/hooks/useConsultationPayments.ts"],"sourcesContent":["/**\n * Real expert-consultation payments (BOFF-6030, slice B).\n *\n * The client starts checkout and asks HealthyBowl to settle afterwards. HealthyBowl re-reads the\n * authoritative Payment from global-billing, so this MFE never decides that money arrived or handles\n * card data. The documents stay inline because the committed workspace SDL snapshot predates these\n * operations; adding them under `src/operations/wspace` would make codegen validate them too early.\n */\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport { useCallback, useMemo } from 'react';\nimport type { Consultation } from '../types';\nimport { loadRazorpayCheckout } from './useOrderPayments';\n\n/** Everything the client needs to open the payment provider's checkout for one consultation. */\nexport interface ConsultationCheckout {\n consultationId: string;\n billingOrderId: string;\n /** RAZORPAY / STRIPE — selected by platform billing. */\n provider: string;\n /** Razorpay `order_xxx`; absent when billing routes to another provider. */\n providerOrderId?: string | null;\n /** Publishable Razorpay key returned at runtime by billing, never hard-coded. */\n razorpayKeyId?: string | null;\n /** Stripe client secret; this MFE does not implement the Stripe checkout path yet. */\n clientSecret?: string | null;\n subtotal: number;\n taxAmount: number;\n total: number;\n currency: string;\n}\n\n/** Payment details mirrored by HealthyBowl only after it settles against platform billing. */\nexport type ConsultationPayment = Pick<\n Consultation,\n 'id' | 'status' | 'paymentStatus' | 'paymentProvider' | 'paymentReference' | 'paidAmount' | 'paidAt'\n>;\n\nconst CHECKOUT_CONSULTATION = gql`\n mutation CheckoutHealthyBowlConsultation($consultationId: ID!, $context: ContextInput!) {\n checkoutHealthyBowlConsultation(consultationId: $consultationId, context: $context) {\n consultationId\n billingOrderId\n provider\n providerOrderId\n razorpayKeyId\n clientSecret\n subtotal\n taxAmount\n total\n currency\n }\n }\n`;\n\nconst SYNC_CONSULTATION_PAYMENT = gql`\n mutation SyncHealthyBowlConsultationPayment($consultationId: ID!, $context: ContextInput!) {\n syncHealthyBowlConsultationPayment(consultationId: $consultationId, context: $context) {\n id\n status\n paymentStatus\n paymentProvider\n paymentReference\n paidAmount\n paidAt\n }\n }\n`;\n\ninterface CheckoutConsultationData {\n checkoutHealthyBowlConsultation: ConsultationCheckout;\n}\n\ninterface SyncConsultationPaymentData {\n syncHealthyBowlConsultationPayment: ConsultationPayment;\n}\n\ninterface ConsultationCheckoutVariables {\n consultationId: string;\n context: Record<string, never>;\n}\n\ninterface SyncConsultationPaymentVariables {\n consultationId: string;\n context: Record<string, never>;\n}\n\n/**\n * Starts idempotent platform-billing checkout sessions and settles their authoritative result.\n * `loadRazorpay` deliberately delegates to the shared lazy script loader, so marketplace and\n * consultation checkout inject at most one provider script per page.\n */\nexport function useConsultationPayments() {\n // Wspace identity is gateway-authoritative; this required GraphQL input intentionally carries no\n // client-held workspace id.\n const context = useMemo<Record<string, never>>(() => ({}), []);\n const [checkoutMutation] = useMutation<CheckoutConsultationData, ConsultationCheckoutVariables>(\n CHECKOUT_CONSULTATION\n );\n const [syncMutation] = useMutation<SyncConsultationPaymentData, SyncConsultationPaymentVariables>(\n SYNC_CONSULTATION_PAYMENT\n );\n\n const checkoutConsultation = useCallback(\n async (consultationId: string): Promise<ConsultationCheckout> => {\n const result = await checkoutMutation({ variables: { consultationId, context } });\n const checkout = result.data?.checkoutHealthyBowlConsultation;\n if (!checkout) throw new Error('Checkout did not return a payment session');\n return checkout;\n },\n [checkoutMutation, context]\n );\n\n const syncConsultationPayment = useCallback(\n async (consultationId: string): Promise<ConsultationPayment> => {\n const result = await syncMutation({ variables: { consultationId, context } });\n const consultation = result.data?.syncHealthyBowlConsultationPayment;\n if (!consultation) throw new Error('Payment sync did not return the consultation');\n return consultation;\n },\n [context, syncMutation]\n );\n\n const loadRazorpay = loadRazorpayCheckout;\n\n return { checkoutConsultation, syncConsultationPayment, loadRazorpay };\n}\n"],"mappings":";;;;;AAsCA,IAAM,IAAwB,CAAG;;;;;;;;;;;;;;;GAiB3B,IAA4B,CAAG;;;;;;;;;;;;;AAqCrC,SAAgB,IAA0B;CAGxC,IAAM,IAAU,SAAsC,CAAC,IAAI,CAAC,CAAC,GACvD,CAAC,KAAoB,EACzB,CACF,GACM,CAAC,KAAgB,EACrB,CACF;CAwBA,OAAO;EAAE,sBAtBoB,EAC3B,OAAO,MAA0D;GAE/D,IAAM,KAAW,MADI,EAAiB,EAAE,WAAW;IAAE;IAAgB;GAAQ,EAAE,CAAC,GACxD,MAAM;GAC9B,IAAI,CAAC,GAAU,MAAU,MAAM,2CAA2C;GAC1E,OAAO;EACT,GACA,CAAC,GAAkB,CAAO,CAenB;EAAsB,yBAZC,EAC9B,OAAO,MAAyD;GAE9D,IAAM,KAAe,MADA,EAAa,EAAE,WAAW;IAAE;IAAgB;GAAQ,EAAE,CAAC,GAChD,MAAM;GAClC,IAAI,CAAC,GAAc,MAAU,MAAM,8CAA8C;GACjF,OAAO;EACT,GACA,CAAC,GAAS,CAAY,CAKO;EAAyB,cAAA;CAAa;AACvE"}
@@ -1,49 +0,0 @@
1
- //#region src/healthybowl/pages/government-schemes/schemeApplicationTransitions.ts
2
- var e = {
3
- submitted: ["under_review", "rejected"],
4
- under_review: ["approved", "rejected"],
5
- approved: ["disbursed"],
6
- rejected: [],
7
- disbursed: []
8
- }, t = {
9
- submitted: {
10
- labelKey: "healthybowl.governmentSchemes.tracking.action.submitted",
11
- labelFallback: "Mark submitted",
12
- destructive: !1
13
- },
14
- under_review: {
15
- labelKey: "healthybowl.governmentSchemes.tracking.action.underReview",
16
- labelFallback: "Move to under review",
17
- destructive: !1
18
- },
19
- approved: {
20
- labelKey: "healthybowl.governmentSchemes.tracking.action.approved",
21
- labelFallback: "Approve",
22
- destructive: !1
23
- },
24
- rejected: {
25
- labelKey: "healthybowl.governmentSchemes.tracking.action.rejected",
26
- labelFallback: "Reject",
27
- destructive: !0
28
- },
29
- disbursed: {
30
- labelKey: "healthybowl.governmentSchemes.tracking.action.disbursed",
31
- labelFallback: "Mark disbursed",
32
- destructive: !1
33
- }
34
- };
35
- function n(n) {
36
- let r = e[n];
37
- return r ? r.map((e) => ({
38
- status: e,
39
- ...t[e]
40
- })) : [];
41
- }
42
- function r(t) {
43
- let n = e[t];
44
- return n !== void 0 && n.length === 0;
45
- }
46
- //#endregion
47
- export { r as isTerminalSchemeApplicationStatus, n as transitionActionsFor };
48
-
49
- //# sourceMappingURL=schemeApplicationTransitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemeApplicationTransitions.js","names":[],"sources":["../../../../src/healthybowl/pages/government-schemes/schemeApplicationTransitions.ts"],"sourcesContent":["/**\n * Government scheme-application transitions (BOFF-6037) — pure, so it is unit-testable.\n *\n * Mirrors `SCHEME_APPLICATION_TRANSITIONS` in wspace-healthybowl-svc's\n * `HealthyBowlDomainProvider`. The server is the authority — it refuses an illegal edge with\n * `BAD_USER_INPUT` — and this exists so the page offers only the buttons that will work, rather\n * than showing four and letting three of them fail.\n *\n * Statuses arrive from the API **lower-cased** (`toLowerEnum`), which is what the tracking page\n * already renders, so this map is keyed the same way.\n *\n * @module healthybowl\n */\n\nexport type SchemeApplicationStatus = 'submitted' | 'under_review' | 'approved' | 'rejected' | 'disbursed';\n\n/**\n * Legal next states, by current state.\n *\n * No `submitted → disbursed` skip: money must not move without a recorded approval. `submitted →\n * rejected` is direct, because an ineligible applicant is refused on sight and forcing a review\n * cycle would be theatre. Terminal states offer nothing, and there are no self-edges — so a\n * double-clicked button cannot produce a duplicate audit row.\n */\nexport const SCHEME_APPLICATION_TRANSITIONS: Readonly<\n Record<SchemeApplicationStatus, readonly SchemeApplicationStatus[]>\n> = {\n submitted: ['under_review', 'rejected'],\n under_review: ['approved', 'rejected'],\n approved: ['disbursed'],\n rejected: [],\n disbursed: [],\n};\n\nexport interface TransitionAction {\n status: SchemeApplicationStatus;\n labelKey: string;\n labelFallback: string;\n /** A refusal is a heavier act than an advance, so it is styled apart. */\n destructive: boolean;\n}\n\nconst ACTION_COPY: Readonly<Record<SchemeApplicationStatus, Omit<TransitionAction, 'status'>>> = {\n submitted: {\n labelKey: 'healthybowl.governmentSchemes.tracking.action.submitted',\n labelFallback: 'Mark submitted',\n destructive: false,\n },\n under_review: {\n labelKey: 'healthybowl.governmentSchemes.tracking.action.underReview',\n labelFallback: 'Move to under review',\n destructive: false,\n },\n approved: {\n labelKey: 'healthybowl.governmentSchemes.tracking.action.approved',\n labelFallback: 'Approve',\n destructive: false,\n },\n rejected: {\n labelKey: 'healthybowl.governmentSchemes.tracking.action.rejected',\n labelFallback: 'Reject',\n destructive: true,\n },\n disbursed: {\n labelKey: 'healthybowl.governmentSchemes.tracking.action.disbursed',\n labelFallback: 'Mark disbursed',\n destructive: false,\n },\n};\n\n/**\n * The actions offered for an application in this state.\n *\n * An unrecognised status yields none rather than guessing: a state this client does not know about\n * is a state it has no business moving.\n */\nexport function transitionActionsFor(status: string): TransitionAction[] {\n const next = SCHEME_APPLICATION_TRANSITIONS[status as SchemeApplicationStatus];\n if (!next) return [];\n return next.map((target) => ({ status: target, ...ACTION_COPY[target] }));\n}\n\n/** True when the application has reached a state nothing can move it out of. */\nexport function isTerminalSchemeApplicationStatus(status: string): boolean {\n const next = SCHEME_APPLICATION_TRANSITIONS[status as SchemeApplicationStatus];\n return next !== undefined && next.length === 0;\n}\n"],"mappings":";AAwBA,IAAa,IAET;CACF,WAAW,CAAC,gBAAgB,UAAU;CACtC,cAAc,CAAC,YAAY,UAAU;CACrC,UAAU,CAAC,WAAW;CACtB,UAAU,CAAC;CACX,WAAW,CAAC;AACd,GAUM,IAA2F;CAC/F,WAAW;EACT,UAAU;EACV,eAAe;EACf,aAAa;CACf;CACA,cAAc;EACZ,UAAU;EACV,eAAe;EACf,aAAa;CACf;CACA,UAAU;EACR,UAAU;EACV,eAAe;EACf,aAAa;CACf;CACA,UAAU;EACR,UAAU;EACV,eAAe;EACf,aAAa;CACf;CACA,WAAW;EACT,UAAU;EACV,eAAe;EACf,aAAa;CACf;AACF;AAQA,SAAgB,EAAqB,GAAoC;CACvE,IAAM,IAAO,EAA+B;CAE5C,OADK,IACE,EAAK,KAAK,OAAY;EAAE,QAAQ;EAAQ,GAAG,EAAY;CAAQ,EAAE,IADtD,CAAC;AAErB;AAGA,SAAgB,EAAkC,GAAyB;CACzE,IAAM,IAAO,EAA+B;CAC5C,OAAO,MAAS,KAAA,KAAa,EAAK,WAAW;AAC/C"}
@@ -1,48 +0,0 @@
1
- //#region src/healthybowl/pages/government-schemes/schemeDocumentSlots.ts
2
- var e = [
3
- {
4
- slot: "FARM_OWNERSHIP",
5
- required: !0,
6
- labelKey: "healthybowl.governmentSchemes.schemeDetails.form.documents.ownershipProof",
7
- labelFallback: "Farm Ownership / Lease Proof"
8
- },
9
- {
10
- slot: "GOVERNMENT_ID",
11
- required: !0,
12
- labelKey: "healthybowl.governmentSchemes.schemeDetails.form.documents.idDocument",
13
- labelFallback: "Government-issued ID"
14
- },
15
- {
16
- slot: "BANK_DETAILS",
17
- required: !0,
18
- labelKey: "healthybowl.governmentSchemes.schemeDetails.form.documents.bankDetails",
19
- labelFallback: "Bank Account Details"
20
- },
21
- {
22
- slot: "ORGANIC_CERTIFICATE",
23
- required: !1,
24
- labelKey: "healthybowl.governmentSchemes.schemeDetails.form.documents.certification",
25
- labelFallback: "Organic Certification (if applicable)"
26
- }
27
- ];
28
- function t(t) {
29
- let n = new Set(t.map((e) => e.slot));
30
- return e.filter((e) => e.required && !n.has(e.slot));
31
- }
32
- function n(e) {
33
- return t(e).length === 0;
34
- }
35
- function r(t, n) {
36
- let r = new Map(t.map((e) => [e.slot, e]));
37
- return r.set(n.slot, n), e.map((e) => r.get(e.slot)).filter((e) => e !== void 0);
38
- }
39
- function i(e, t) {
40
- return e.filter((e) => e.slot !== t);
41
- }
42
- function a(e, t) {
43
- return e.find((e) => e.slot === t) ?? null;
44
- }
45
- //#endregion
46
- export { e as SCHEME_DOCUMENT_SLOT_SPECS, n as canSubmitSchemeApplication, a as documentForSlot, t as missingRequiredSchemeDocuments, i as removeSchemeDocument, r as setSchemeDocument };
47
-
48
- //# sourceMappingURL=schemeDocumentSlots.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemeDocumentSlots.js","names":[],"sources":["../../../../src/healthybowl/pages/government-schemes/schemeDocumentSlots.ts"],"sourcesContent":["/**\n * Scheme-application document slots (BOFF-6111) — pure, so it is unit-testable.\n *\n * The application form used to show four checkboxes under \"Confirm you have the following documents\n * ready for upload\", join them into an English sentence, and append that to the application's free\n * text. Nothing was uploaded. These are the four slots that replace them, plus the rules about\n * which are required and when the form may be submitted.\n *\n * Mirrors `SCHEME_DOCUMENT_SLOTS` / `REQUIRED_SCHEME_DOCUMENT_SLOTS` in wspace-healthybowl-svc's\n * `government/scheme-documents.ts`. The server is the authority; this exists so the farmer is told\n * what is missing before a round trip, and so the outbox never queues an application the server\n * will refuse.\n *\n * @module healthybowl\n */\n\nexport type SchemeDocumentSlot = 'FARM_OWNERSHIP' | 'GOVERNMENT_ID' | 'BANK_DETAILS' | 'ORGANIC_CERTIFICATE';\n\nexport interface SchemeDocumentSlotSpec {\n slot: SchemeDocumentSlot;\n required: boolean;\n labelKey: string;\n labelFallback: string;\n}\n\n/** Declaration order is display order, and the order the server returns documents in. */\nexport const SCHEME_DOCUMENT_SLOT_SPECS: readonly SchemeDocumentSlotSpec[] = [\n {\n slot: 'FARM_OWNERSHIP',\n required: true,\n labelKey: 'healthybowl.governmentSchemes.schemeDetails.form.documents.ownershipProof',\n labelFallback: 'Farm Ownership / Lease Proof',\n },\n {\n slot: 'GOVERNMENT_ID',\n required: true,\n labelKey: 'healthybowl.governmentSchemes.schemeDetails.form.documents.idDocument',\n labelFallback: 'Government-issued ID',\n },\n {\n slot: 'BANK_DETAILS',\n required: true,\n labelKey: 'healthybowl.governmentSchemes.schemeDetails.form.documents.bankDetails',\n labelFallback: 'Bank Account Details',\n },\n {\n slot: 'ORGANIC_CERTIFICATE',\n required: false,\n labelKey: 'healthybowl.governmentSchemes.schemeDetails.form.documents.certification',\n labelFallback: 'Organic Certification (if applicable)',\n },\n];\n\n/** One uploaded document held in form state. */\nexport interface UploadedSchemeDocument {\n slot: SchemeDocumentSlot;\n fileId: string;\n fileName: string | null;\n uploadedAt: string;\n}\n\n/** The required slots that still have no upload. */\nexport function missingRequiredSchemeDocuments(documents: readonly UploadedSchemeDocument[]): SchemeDocumentSlotSpec[] {\n const present = new Set(documents.map((doc) => doc.slot));\n return SCHEME_DOCUMENT_SLOT_SPECS.filter((spec) => spec.required && !present.has(spec.slot));\n}\n\n/** True when every required document has been uploaded. */\nexport function canSubmitSchemeApplication(documents: readonly UploadedSchemeDocument[]): boolean {\n return missingRequiredSchemeDocuments(documents).length === 0;\n}\n\n/**\n * Replace or add the document in a slot.\n *\n * Last-write-wins per slot, matching the server, so re-uploading corrects a mistake rather than\n * attaching two files to one requirement. Order follows the slot specs, not upload order, so the\n * list reads the same way the form asks for it.\n */\nexport function setSchemeDocument(\n documents: readonly UploadedSchemeDocument[],\n next: UploadedSchemeDocument\n): UploadedSchemeDocument[] {\n const bySlot = new Map(documents.map((doc) => [doc.slot, doc]));\n bySlot.set(next.slot, next);\n return SCHEME_DOCUMENT_SLOT_SPECS.map((spec) => bySlot.get(spec.slot)).filter(\n (doc): doc is UploadedSchemeDocument => doc !== undefined\n );\n}\n\n/** Remove whatever is attached to a slot. */\nexport function removeSchemeDocument(\n documents: readonly UploadedSchemeDocument[],\n slot: SchemeDocumentSlot\n): UploadedSchemeDocument[] {\n return documents.filter((doc) => doc.slot !== slot);\n}\n\n/** The document attached to a slot, if any. */\nexport function documentForSlot(\n documents: readonly UploadedSchemeDocument[],\n slot: SchemeDocumentSlot\n): UploadedSchemeDocument | null {\n return documents.find((doc) => doc.slot === slot) ?? null;\n}\n"],"mappings":";AA0BA,IAAa,IAAgE;CAC3E;EACE,MAAM;EACN,UAAU;EACV,UAAU;EACV,eAAe;CACjB;CACA;EACE,MAAM;EACN,UAAU;EACV,UAAU;EACV,eAAe;CACjB;CACA;EACE,MAAM;EACN,UAAU;EACV,UAAU;EACV,eAAe;CACjB;CACA;EACE,MAAM;EACN,UAAU;EACV,UAAU;EACV,eAAe;CACjB;AACF;AAWA,SAAgB,EAA+B,GAAwE;CACrH,IAAM,IAAU,IAAI,IAAI,EAAU,KAAK,MAAQ,EAAI,IAAI,CAAC;CACxD,OAAO,EAA2B,QAAQ,MAAS,EAAK,YAAY,CAAC,EAAQ,IAAI,EAAK,IAAI,CAAC;AAC7F;AAGA,SAAgB,EAA2B,GAAuD;CAChG,OAAO,EAA+B,CAAS,EAAE,WAAW;AAC9D;AASA,SAAgB,EACd,GACA,GAC0B;CAC1B,IAAM,IAAS,IAAI,IAAI,EAAU,KAAK,MAAQ,CAAC,EAAI,MAAM,CAAG,CAAC,CAAC;CAE9D,OADA,EAAO,IAAI,EAAK,MAAM,CAAI,GACnB,EAA2B,KAAK,MAAS,EAAO,IAAI,EAAK,IAAI,CAAC,EAAE,QACpE,MAAuC,MAAQ,KAAA,CAClD;AACF;AAGA,SAAgB,EACd,GACA,GAC0B;CAC1B,OAAO,EAAU,QAAQ,MAAQ,EAAI,SAAS,CAAI;AACpD;AAGA,SAAgB,EACd,GACA,GAC+B;CAC/B,OAAO,EAAU,MAAM,MAAQ,EAAI,SAAS,CAAI,KAAK;AACvD"}