forked from git.gladyson/openmonetis
React 19 compiler auto-optimizes memoization, making manual hooks unnecessary. Changes: - Remove ~60 useCallback/useMemo across 16 files - Remove React.memo from nav-button and return-button - Simplify hydration with useSyncExternalStore (privacy-provider) - Add CHANGELOG.md for version tracking No functional changes - internal optimization only. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
896 B
TypeScript
31 lines
896 B
TypeScript
"use client";
|
|
|
|
import { RiArrowLeftSLine, RiArrowRightSLine } from "@remixicon/react";
|
|
|
|
interface NavigationButtonProps {
|
|
direction: "left" | "right";
|
|
disabled?: boolean;
|
|
onClick: () => void;
|
|
}
|
|
|
|
export default function NavigationButton({
|
|
direction,
|
|
disabled,
|
|
onClick,
|
|
}: NavigationButtonProps) {
|
|
const Icon = direction === "left" ? RiArrowLeftSLine : RiArrowRightSLine;
|
|
|
|
return (
|
|
<button
|
|
onClick={onClick}
|
|
className="text-month-picker-foreground transition-all duration-200 cursor-pointer rounded-lg p-1 hover:bg-month-picker-foreground/10 focus:outline-hidden focus:ring-2 focus:ring-month-picker-foreground/30 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent"
|
|
disabled={disabled}
|
|
aria-label={`Navegar para o mês ${
|
|
direction === "left" ? "anterior" : "seguinte"
|
|
}`}
|
|
>
|
|
<Icon className="text-primary" size={18} />
|
|
</button>
|
|
);
|
|
}
|