first commit
This commit is contained in:
25
components/theme-toggle.tsx
Normal file
25
components/theme-toggle.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { Moon, Sun } from "lucide-react";
|
||||
import { useTheme } from "@/components/theme-provider";
|
||||
|
||||
export function ThemeToggle() {
|
||||
const { theme, toggleTheme } = useTheme();
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleTheme}
|
||||
className="rounded-md p-2 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-white"
|
||||
aria-label={theme === "dark" ? "Aydınlık temaya geç" : "Koyu temaya geç"}
|
||||
title={theme === "dark" ? "Aydınlık tema" : "Koyu tema"}
|
||||
>
|
||||
{theme === "dark" ? (
|
||||
<Sun className="size-5" />
|
||||
) : (
|
||||
<Moon className="size-5" />
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user