Header.tsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. "use client";
  2. import Link from "next/link";
  3. import { Button } from "@/components/ui/button";
  4. import { Github } from "lucide-react";
  5. import { websiteConfig } from "@/lib/website-config";
  6. /**
  7. * 官网顶部导航栏
  8. * 包含 Logo、导航链接和 GitHub 链接
  9. */
  10. export function Header() {
  11. return (
  12. <header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
  13. <div className="container mx-auto px-4">
  14. <div className="flex h-16 items-center justify-between">
  15. {/* Logo 和品牌名称 */}
  16. <Link href="/" className="flex items-center space-x-2">
  17. <div className="flex items-center space-x-2">
  18. <div className="w-8 h-8 rounded-lg bg-primary flex items-center justify-center">
  19. <span className="text-primary-foreground font-bold text-lg">AI</span>
  20. </div>
  21. <span className="text-xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent">
  22. AI-CS
  23. </span>
  24. </div>
  25. </Link>
  26. {/* 右侧:导航链接和操作按钮 */}
  27. <div className="flex items-center space-x-6">
  28. {/* 导航链接 */}
  29. <nav className="hidden md:flex items-center space-x-6">
  30. <Link
  31. href="#features"
  32. className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
  33. >
  34. 功能特性
  35. </Link>
  36. <Link
  37. href="#screenshots"
  38. className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
  39. >
  40. 界面展示
  41. </Link>
  42. <Link
  43. href="#faq"
  44. className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
  45. >
  46. 常见问题
  47. </Link>
  48. <Link
  49. href="/agent/login"
  50. className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
  51. >
  52. 客服登录
  53. </Link>
  54. </nav>
  55. {/* GitHub 链接 */}
  56. <Button
  57. variant="ghost"
  58. size="sm"
  59. asChild
  60. className="hidden sm:flex"
  61. >
  62. <a
  63. href={websiteConfig.github.repo}
  64. target="_blank"
  65. rel="noopener noreferrer"
  66. className="flex items-center space-x-2"
  67. >
  68. <Github className="w-4 h-4" />
  69. <span>GitHub</span>
  70. </a>
  71. </Button>
  72. {/* 移动端 GitHub 图标按钮 */}
  73. <Button
  74. variant="ghost"
  75. size="icon"
  76. asChild
  77. className="sm:hidden"
  78. >
  79. <a
  80. href={websiteConfig.github.repo}
  81. target="_blank"
  82. rel="noopener noreferrer"
  83. aria-label="GitHub"
  84. >
  85. <Github className="w-5 h-5" />
  86. </a>
  87. </Button>
  88. </div>
  89. </div>
  90. </div>
  91. </header>
  92. );
  93. }