--- import { Icon } from "astro-icon/components"; import { LinkPresets } from "@/constants/link-presets"; import { LinkPreset, type NavBarLink } from "@/types/config"; import { url } from "@/utils/url-utils"; interface Props { links: NavBarLink[]; } // 处理links中的LinkPreset转换 const processedLinks = Astro.props.links.map((link: NavBarLink) => ({ ...link, children: link.children?.map((child: NavBarLink | LinkPreset): NavBarLink => { if (typeof child === "number") { return LinkPresets[child]; } return child; }), })); ---