- Add jscodeshift-based codemod to convert arrow function components to function declarations - Support React.FC, observer-wrapped, and forwardRef components - Include comprehensive test suite covering edge cases - Add npm script to run transformer across codebase - Target only .tsx files in source directories, excluding node_modules and declaration files * [WEB-5459] chore: updates after running codemod --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
41 lines
912 B
TypeScript
41 lines
912 B
TypeScript
import React from "react";
|
|
import { cn } from "../utils";
|
|
|
|
export interface AuthForgotPasswordProps {
|
|
onForgotPassword?: () => void;
|
|
className?: string;
|
|
text?: string;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
export function AuthForgotPassword({
|
|
onForgotPassword,
|
|
className = "",
|
|
text = "Forgot your password?",
|
|
disabled = false,
|
|
}: AuthForgotPasswordProps) {
|
|
const handleClick = (e: React.MouseEvent) => {
|
|
e.preventDefault();
|
|
if (!disabled && onForgotPassword) {
|
|
onForgotPassword();
|
|
}
|
|
};
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={handleClick}
|
|
disabled={disabled}
|
|
className={cn(
|
|
"text-sm text-custom-primary-100 hover:text-custom-primary-200 transition-colors duration-200",
|
|
{
|
|
"opacity-50 cursor-not-allowed": disabled,
|
|
"cursor-pointer": !disabled,
|
|
},
|
|
className
|
|
)}
|
|
>
|
|
{text}
|
|
</button>
|
|
);
|
|
}
|