Files
next-fiber/components/theme-toggle.tsx
Beyhan Oğur b2825e1698 first commit
2026-04-26 22:14:08 +03:00

26 lines
750 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"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>
);
}