mirror of
https://github.com/quantum5/totp.git
synced 2025-08-02 12:18:20 -04:00
13 lines
449 B
TypeScript
13 lines
449 B
TypeScript
import React from 'react';
|
|
|
|
type HTMLAnchorProps = Omit<React.HTMLProps<HTMLAnchorElement>, 'href' | 'onClick'>;
|
|
|
|
export default function ActionLink({onClick, className, ...props}: HTMLAnchorProps & { onClick: () => void }) {
|
|
const handleClick = React.useCallback((e: React.SyntheticEvent) => {
|
|
e.preventDefault();
|
|
onClick();
|
|
}, [onClick]);
|
|
|
|
return <a className={`totp-action-link ${className}`} onClick={handleClick} {...props} />;
|
|
}
|