mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-02 19:26:50 -05:00
This broke after upgrading deps and couldn't figure it out with a quick look. It just makes it a bit more convenient when adding new pages & debugging but not really that necessary so decided to delete it for now.
29 lines
705 B
TypeScript
29 lines
705 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { MoonIcon } from "../icons/Moon";
|
|
import { SunIcon } from "../icons/Sun";
|
|
import { SunAndMoonIcon } from "../icons/SunAndMoon";
|
|
import { Theme, useTheme } from "~/features/theme/core/provider";
|
|
|
|
const ThemeIcons = {
|
|
[Theme.LIGHT]: SunIcon,
|
|
[Theme.DARK]: MoonIcon,
|
|
auto: SunAndMoonIcon,
|
|
};
|
|
|
|
export function SelectedThemeIcon({ size }: { size?: number }) {
|
|
const { t } = useTranslation();
|
|
const { userTheme } = useTheme();
|
|
|
|
if (!userTheme) return null;
|
|
|
|
const SelectedIcon = ThemeIcons[userTheme];
|
|
|
|
return (
|
|
<SelectedIcon
|
|
alt={t("header.theme")}
|
|
className="layout__header__button__icon"
|
|
size={size}
|
|
/>
|
|
);
|
|
}
|