keycloak-scim/src/components/external-link/ExternalLink.tsx

23 lines
489 B
TypeScript
Raw Normal View History

import React from "react";
import { ExternalLinkAltIcon } from "@patternfly/react-icons";
2020-09-21 20:12:53 +00:00
import { Button } from "@patternfly/react-core";
2020-09-01 08:25:24 +00:00
export const ExternalLink = ({
title,
href,
...rest
}: React.HTMLProps<HTMLAnchorElement>) => {
return (
2020-09-21 20:12:53 +00:00
<Button
variant="link"
icon={href?.startsWith("http") && <ExternalLinkAltIcon />}
iconPosition="right"
component="a"
href={href}
{...rest}
>
{title ? title : href}
</Button>
2020-09-01 08:25:24 +00:00
);
};