Complete EHSAN POC: fix all code review findings

- API routes: explicit return types on all Express handlers (fixes TS7030),
  `beneficiaryName` now accepted and stored in /thank-you route per OpenAPI spec.

- Home page: added search bar (filters by case ID, description, name) +
  Featured Opportunities section with live cards, progress bars, and Donate buttons.

- Opportunities page: added need-type filter pill bar (all 8 types + "All Types")
  with active state highlighting; empty state respects selected filter.

- i18n: expanded translations with all previously hardcoded strings
  (trackCase, notFound, noData, currentStep, search, searchPlaceholder,
  featuredTitle, noResults, donate.caseSummary, donate.caseNotFound,
  admin.noRequests, admin.needType, admin.amount, admin.track, admin.whatsapp,
  track.caseInfo, track.rejected, track.currentStepLabel, track.submitThankYou,
  thankYou.successNote, thankYou.beneficiaryMessageLabel,
  whatsapp.donorPhone, whatsapp.beneficiaryMessage, whatsapp.noEntries,
  opportunities.noOpportunities, opportunities.verified).
  All pages now use t.* — zero hardcoded English UI strings.

- TypeScript: both frontend (tsc --noEmit) and API server build are clean.
This commit is contained in:
Replit Agent
2026-06-05 17:12:44 +00:00
parent 12111a9562
commit 1dcfa0bfa5
9 changed files with 640 additions and 258 deletions
@@ -1,5 +1,8 @@
import { useLanguage } from "../contexts/LanguageContext";
import { useListWhatsappLog, useSendWhatsapp, getListWhatsappLogQueryKey, getListRequestsQueryKey } from "@workspace/api-client-react";
import {
useListWhatsappLog, useSendWhatsapp,
getListWhatsappLogQueryKey, getListRequestsQueryKey, useListRequests,
} from "@workspace/api-client-react";
import { useQueryClient } from "@tanstack/react-query";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
@@ -7,7 +10,6 @@ import { Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
import { Separator } from "@/components/ui/separator";
import { MessageSquare, Phone, Send, CheckCircle, Clock, XCircle } from "lucide-react";
import { useListRequests } from "@workspace/api-client-react";
export default function WhatsappLog() {
const { t } = useLanguage();
@@ -67,7 +69,7 @@ export default function WhatsappLog() {
) : !logs || logs.length === 0 ? (
<Card>
<CardContent className="py-16 text-center text-muted-foreground">
No WhatsApp log entries yet.
{t.whatsapp.noEntries}
</CardContent>
</Card>
) : (
@@ -118,7 +120,7 @@ export default function WhatsappLog() {
{/* Beneficiary Message */}
<div>
<p className="text-xs font-semibold uppercase text-muted-foreground tracking-wide mb-2">
Beneficiary Message
{t.thankYou.beneficiaryMessageLabel}
</p>
<p className="text-sm text-foreground italic">"{log.beneficiaryMessage}"</p>
</div>