| 1 |
import { isValidElement } from 'react'; |
| 2 |
export interface LoginFooterItemProps extends React.HTMLProps<HTMLAnchorElement> { |
| 3 |
/** Content rendered inside the footer link item */ |
| 4 |
children?: React.ReactNode; |
| 5 |
/** Additional classes added to the footer link item */ |
| 6 |
className?: string; |
| 7 |
/** The URL of the footer link item */ |
| 8 |
href?: string; |
| 9 |
/** Specifies where to open the linked document */ |
| 10 |
target?: string; |
| 11 |
} |
| 12 |
|
| 13 |
export const LoginFooterItem: React.FunctionComponent<LoginFooterItemProps> = ({ |
| 14 |
children = null, |
| 15 |
href = '#', |
| 16 |
target = '_blank', |
| 17 |
...props |
| 18 |
}: LoginFooterItemProps) => |
| 19 |
isValidElement(children) ? ( |
| 20 |
children |
| 21 |
) : ( |
| 22 |
<a target={target} href={href} {...props}> |
| 23 |
{children} |
| 24 |
</a> |
| 25 |
); |
| 26 |
LoginFooterItem.displayName = 'LoginFooterItem'; |