Refactor function components across multiple files

Function components have been refactored across the codebase. Single export-const arrow function components have been adapted into traditional function declarations. This change provides better stack trace in case of errors and better function and argument names on runtime debugging.
This commit is contained in:
giancarlo
2024-05-05 13:31:40 +07:00
parent de15abb801
commit d7d3693f41
20 changed files with 144 additions and 88 deletions

View File

@@ -2,10 +2,13 @@ import Link from 'next/link';
import { cn } from '@kit/ui/utils';
const LogoImage: React.FC<{
function LogoImage({
className,
width = 105,
}: {
className?: string;
width?: number;
}> = ({ className, width = 105 }) => {
}) {
return (
<svg
width={width}
@@ -21,16 +24,20 @@ const LogoImage: React.FC<{
/>
</svg>
);
};
}
export const AppLogo: React.FC<{
export function AppLogo({
href,
label,
className,
}: {
href?: string;
className?: string;
label?: string;
}> = ({ href, label, className }) => {
}) {
return (
<Link aria-label={label ?? 'Home Page'} href={href ?? '/'}>
<LogoImage className={className} />
</Link>
);
};
}