diff --git a/packages/website/src/components/Navbar.astro b/packages/website/src/components/Navbar.astro index 3942cf0e9..7df59c096 100644 --- a/packages/website/src/components/Navbar.astro +++ b/packages/website/src/components/Navbar.astro @@ -1,5 +1,4 @@ --- -import { assertSecret } from "@blitzkit/core"; import { Cross1Icon, DiscordLogoIcon, @@ -7,18 +6,20 @@ import { HamburgerMenuIcon, } from "@radix-ui/react-icons"; import { Box, Code, Flex, IconButton, Link } from "@radix-ui/themes"; -import { TOOLS } from "../constants/tools"; import { resolveBranchName } from "../core/blitzkit/branches"; import { getStrings } from "../core/i18n/getStrings"; import { Var } from "../core/radix/var"; import { LinkI18n } from "./LinkI18n"; +import { tools } from "../constants/tools"; export interface Props { integrated?: boolean; } const { integrated = false } = Astro.props; -const toolsFiltered = TOOLS.filter((tool) => !tool.href && !tool.disabled); +const toolsFiltered = Object.entries(tools).filter( + ([, tool]) => !tool.href && !tool.disabled +); const { locale } = Astro.params; const branchName = resolveBranchName(locale); const isBranchNamed = branchName !== undefined; @@ -137,16 +138,13 @@ const strings = getStrings(locale); className="tools" > { - toolsFiltered.map((tool) => { + toolsFiltered.map(([id, tool]) => { const selected = Astro.url.pathname.includes(`/${tool.id}`); const toolStrings = strings.website.tools[ - (tool.strings ?? - tool.id) as keyof typeof strings.website.tools + (tool.strings ?? id) as keyof typeof strings.website.tools ]; - if (toolStrings === undefined) console.log(tool.id); - return ( { - toolsFiltered.map((tool) => { + toolsFiltered.map(([id, tool]) => { const toolStrings = strings.website.tools[ - (tool.strings ?? tool.id) as keyof typeof strings.website.tools + (tool.strings ?? id) as keyof typeof strings.website.tools ]; return ( diff --git a/packages/website/src/components/ToolCard.astro b/packages/website/src/components/ToolCard.astro index e8e8455fd..9ef884d09 100644 --- a/packages/website/src/components/ToolCard.astro +++ b/packages/website/src/components/ToolCard.astro @@ -1,6 +1,13 @@ --- import { CaretRightIcon } from "@radix-ui/react-icons"; -import { Box, Button, Flex, Heading, Text } from "@radix-ui/themes"; +import { + Box, + Button, + Flex, + Heading, + Text, + type ButtonProps, +} from "@radix-ui/themes"; import type { Tool } from "../constants/tools"; import { getStrings } from "../core/i18n/getStrings"; import { LinkI18n } from "./LinkI18n"; @@ -45,7 +52,9 @@ const toolStrings =