import "./ToolIcon.scss"; import React from "react"; import { t } from "../i18n"; export type Appearence = "light" | "dark"; // We chose to use only explicit toggle and not a third option for system value, // but this could be added in the future. export const DarkModeToggle = (props: { value: Appearence; onChange: (value: Appearence) => void; title?: string; }) => { const title = props.title ? props.title : props.value === "dark" ? t("buttons.lightMode") : t("buttons.darkMode"); return ( ); }; const ICONS = { SUN: ( ), MOON: ( ), };