HotSearch.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. 'use client';
  2. import Link from 'next/link';
  3. // import { createUrl } from '@/utils/helper';
  4. const hotTags = [
  5. {
  6. name: 'HD Wig',
  7. href: '/search?q=HD%20Wig'
  8. },
  9. {
  10. name: 'Glueless Wig',
  11. href: '/search?q=Glueless%20Wig'
  12. },
  13. {
  14. name: 'New Arrival',
  15. href: '/search?q=New%20Arrival'
  16. },
  17. {
  18. name: 'Color Wig',
  19. href: '/search?q=Color%20Wig'
  20. },
  21. {
  22. name: 'Lace Front Wig',
  23. href: '/search?q=Lace%20Front%20Wig'
  24. },
  25. {
  26. name: 'Bundles',
  27. href: '/search?q=Bundles'
  28. },
  29. {
  30. name: 'M Hairline',
  31. href: '/search?q=M%20Hairline'
  32. },
  33. {
  34. name: '13x6',
  35. href: '/search?q=13x6'
  36. },
  37. ];
  38. export default function HotSearch() {
  39. return (
  40. <div className="w-full max-w-screen-2xl mx-auto py-6 pb-8">
  41. <h2 className="text-base font-medium text-black mb-4">Hot Search</h2>
  42. <div className="flex flex-wrap items-center justify-start gap-3">
  43. {hotTags.map((tag) => {
  44. // 构造带q参数的搜索url
  45. return (
  46. <Link
  47. key={tag.name}
  48. href={tag.href}
  49. className="bg-[#F2F2F2FF] rounded-sm px-[15px] py-2 flex items-center justify-center text-sm text-black font-normal"
  50. >
  51. {tag.name}
  52. </Link>
  53. );
  54. })}
  55. </div>
  56. </div>
  57. );
  58. }