refactor: memoize icons on export

This commit is contained in:
rusconn
2023-06-24 09:26:37 +09:00
parent 257080b00d
commit 240fba0e74
14 changed files with 74 additions and 101 deletions

View File

@@ -20,12 +20,10 @@ import { PageSection } from "@/components/page-section";
export default function Page() {
const { theme = "system", setTheme } = useTheme();
const appThemeIcon = useMemo(() => <icons.Paintbrush size={24} />, []);
const appThemeConfig = useMemo(
() => (
<Configuration
icon={appThemeIcon}
icon={<icons.Paintbrush size={24} />}
title="App theme"
description="Select which app theme to display"
control={
@@ -45,7 +43,7 @@ export default function Page() {
}
/>
),
[appThemeIcon, setTheme, theme]
[setTheme, theme]
);
return (