setup-ui-template

This commit is contained in:
phaichayon
2026-04-17 11:10:08 +07:00
parent 0dcbb98f4c
commit 1aa871cdf9
98 changed files with 12704 additions and 215 deletions

View File

@@ -0,0 +1,36 @@
import { useRegisterActions } from 'kbar';
import { useTheme } from 'next-themes';
const useThemeSwitching = () => {
const { theme, setTheme } = useTheme();
const toggleTheme = () => {
setTheme(theme === 'light' ? 'dark' : 'light');
};
const themeAction = [
{
id: 'toggleTheme',
name: 'Toggle Theme',
shortcut: ['t', 't'],
section: 'Theme',
perform: toggleTheme
},
{
id: 'setLightTheme',
name: 'Set Light Theme',
section: 'Theme',
perform: () => setTheme('light')
},
{
id: 'setDarkTheme',
name: 'Set Dark Theme',
section: 'Theme',
perform: () => setTheme('dark')
}
];
useRegisterActions(themeAction, [theme]);
};
export default useThemeSwitching;