refactor(icons): migrate workspace to Icones

This commit is contained in:
Maofeng
2026-09-20 15:52:22 +08:00
parent 1fc56b6982
commit ea00a71112
95 changed files with 1409 additions and 725 deletions
+6 -9
View File
@@ -1,4 +1,4 @@
import { CN, US } from "country-flag-icons/react/1x1"
import { Icon } from "@icones/react"
import {
DropdownMenu,
DropdownMenuContent,
@@ -13,11 +13,6 @@ import { HeaderActionButton } from "@workspace/blocks/layout"
import { appLocales, isAppLocale, type AppLocaleCountry } from "./app-locales"
import { useAppLocale } from "./app-i18n-provider"
const localeFlags = {
CN,
US,
} satisfies Record<AppLocaleCountry, typeof CN>
function LocaleFlag({
country,
className,
@@ -25,8 +20,6 @@ function LocaleFlag({
className?: string
country: AppLocaleCountry
}) {
const Flag = localeFlags[country]
return (
<span
aria-hidden="true"
@@ -35,7 +28,11 @@ function LocaleFlag({
className
)}
>
<Flag className="size-full" />
{country === "CN" ? (
<Icon name="flag:cn-square" className="size-full" />
) : (
<Icon name="flag:us-square" className="size-full" />
)}
</span>
)
}