keycloak-scim/src/components/external-link/ExternalLink.tsx
Sarah Rambacher 0a6281e209 fix button props on external link
Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
2020-09-23 15:39:52 -04:00

18 lines
473 B
TypeScript

import React from "react";
import { ExternalLinkAltIcon } from "@patternfly/react-icons";
import { Button, ButtonProps } from "@patternfly/react-core";
export const ExternalLink = ({ title, href, ...rest }: ButtonProps) => {
return (
<Button
variant="link"
icon={href?.startsWith("http") && <ExternalLinkAltIcon />}
iconPosition="right"
component="a"
href={href}
{...rest}
>
{title ? title : href}
</Button>
);
};