()
| 3 | import { useSettingStore } from "@/store"; |
| 4 | |
| 5 | const ThreeDotsLoader = () => { |
| 6 | const settingStore = useSettingStore(); |
| 7 | const [color, setColor] = useState("gray"); |
| 8 | |
| 9 | useEffect(() => { |
| 10 | const theme = settingStore.setting.theme; |
| 11 | let appearance = theme; |
| 12 | if (theme === "system") { |
| 13 | if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) { |
| 14 | appearance = "dark"; |
| 15 | } else { |
| 16 | appearance = "light"; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | if (appearance === "dark") { |
| 21 | setColor("white"); |
| 22 | } else { |
| 23 | setColor("gray"); |
| 24 | } |
| 25 | }, [settingStore.setting.theme]); |
| 26 | |
| 27 | return <ThreeDots wrapperClass="dark:opacity-60" width="24" height="24" color={color} />; |
| 28 | }; |
| 29 | |
| 30 | export default ThreeDotsLoader; |
nothing calls this directly
no outgoing calls
no test coverage detected