0a6281e209
Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
18 lines
473 B
TypeScript
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>
|
|
);
|
|
};
|