refactor(types): centralize type definitions in shared types file
Move all interface and type definitions to src/types/index.ts to reduce code duplication and improve maintainability. This includes types for components, blog posts, personal info, and localization.
This commit is contained in:
@@ -3,13 +3,12 @@ import LanguageSwitcher from "./LanguageSwitcher";
|
||||
import ThemeToggle from "./ui/theme-toggle";
|
||||
import { useTranslations, getLocalizedPath, type Lang } from "@/i18n/utils";
|
||||
import { useState, useEffect } from "react";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { Menu, X } from "lucide-react";
|
||||
import { defaultLang } from "@/i18n/ui";
|
||||
import { type GlassHeaderProps } from "@/types";
|
||||
|
||||
// 从window.document.documentElement.lang获取当前语言
|
||||
interface GlassHeaderProps {
|
||||
lang?: Lang;
|
||||
}
|
||||
|
||||
export default function GlassHeader({ lang: propLang }: GlassHeaderProps) {
|
||||
// 优先使用props传入的语言,如果没有则尝试从HTML lang属性获取
|
||||
|
||||
Reference in New Issue
Block a user