20 lines
601 B
TypeScript
20 lines
601 B
TypeScript
|
"use client";
|
||
|
|
||
|
import React from 'react';
|
||
|
|
||
|
export default function ThemeSwitcher(){
|
||
|
const [theme, setTheme] = React.useState("dark");
|
||
|
|
||
|
React.useEffect(() => {document.body.setAttribute("data-theme", theme)});
|
||
|
|
||
|
return(
|
||
|
<ul className="p-2 right-0 text-base-content">
|
||
|
<li><a onClick={() => setTheme("light")}>Light</a></li>
|
||
|
<li><a onClick={() => setTheme("dark")}>Dark</a></li>
|
||
|
<li><a onClick={() => setTheme("synthwave")}>Synthwave</a></li>
|
||
|
<li><a onClick={() => setTheme("cyberpunk")}>Cyberpunk</a></li>
|
||
|
<li><a onClick={() => setTheme("valentine")}>Valentine</a></li>
|
||
|
</ul>
|
||
|
);
|
||
|
}
|