Files
HKSingleParty/03_source/frontend/src/auth/components/form-resend-code.tsx
louiscklaw b7cd25b614 build ok,
2025-06-15 11:28:24 +08:00

46 lines
985 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.

import type { BoxProps } from '@mui/material/Box';
import Box from '@mui/material/Box';
import Link from '@mui/material/Link';
// ----------------------------------------------------------------------
type FormResendCodeProps = BoxProps & {
value?: number;
disabled?: boolean;
onResendCode?: () => void;
};
export function FormResendCode({
value,
disabled,
onResendCode,
sx,
...other
}: FormResendCodeProps) {
return (
<Box
sx={[
() => ({
mt: 3,
typography: 'body2',
alignSelf: 'center',
}),
...(Array.isArray(sx) ? sx : [sx]),
]}
{...other}
>
{`Dont have a code? `}
<Link
variant="subtitle2"
onClick={onResendCode}
sx={{
cursor: 'pointer',
...(disabled && { color: 'text.disabled', pointerEvents: 'none' }),
}}
>
Resend {disabled && value && value > 0 && `(${value}s)`}
</Link>
</Box>
);
}