Skip to content

feat: card recommendation page + homepage widget (/goi-y-the) #4

@phucbm

Description

@phucbm

Summary

Personalized card finder: user picks a spending intent + optional monthly spend → ranked card results. Surfaces as /goi-y-the page and a compact homepage widget.

Design ref: public/card-rec.png
Roadmap: roadmap/recommendation-feature.md

Algorithm

Reuse rankCards(cards, { [intentSlug]: spend }) — no new ranking logic.

UI

Two-column layout:

  • Left: Hero + tab toggle (Cá nhân / Doanh nghiệp) + Step 1 intent chips + Step 2 spend selector (optional)
  • Right: Top 5 results with bank logo, card name, cashback tagline, "Xem Thẻ" CTA

Key behaviors

  • URL params ?intent=du-lich&spend=3000000 → shareable results
  • State priority: URL params > localStorage > defaults
  • "Doanh nghiệp" tab → "Coming soon"
  • Homepage widget: compact (3 results) + "Xem đầy đủ" button → full page with current params

Files

File Change
components/marketing/recommendation-finder.tsx New
app/(marketing)/goi-y-the/page.tsx New
lib/spend-options.ts New — extract SPEND_OPTIONS
components/marketing/card-ranking-table.tsx Import shared SPEND_OPTIONS
app/(marketing)/page.tsx Add widget
sitemap Add /goi-y-the

Acceptance Criteria

  • /goi-y-the matches design
  • Intent chip → results populate; spend change → re-rank
  • URL updates on state change; shareable
  • localStorage restores state on reload
  • "Doanh nghiệp" → "Coming soon"
  • Homepage widget with "Xem đầy đủ" button
  • pnpm build + pnpm lint pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions