2021-08-20 17:06:26 +02:00
|
|
|
import React from 'react';
|
2021-09-05 22:52:18 +02:00
|
|
|
import { Link, Text, Badge } from '@chakra-ui/react';
|
2021-08-20 17:06:26 +02:00
|
|
|
|
|
|
|
type BadgeLinkType = {
|
|
|
|
target: string;
|
|
|
|
badgeText: string;
|
|
|
|
href: string;
|
2021-12-05 01:50:05 +01:00
|
|
|
colorScheme?: string;
|
2021-08-20 17:06:26 +02:00
|
|
|
children: React.ReactNode
|
|
|
|
};
|
|
|
|
|
|
|
|
export function BadgeLink(props: BadgeLinkType) {
|
2021-12-05 01:50:05 +01:00
|
|
|
const { target = '_blank', colorScheme='purple', badgeText, href, children } = props;
|
2021-08-20 17:06:26 +02:00
|
|
|
|
|
|
|
return (
|
2021-12-05 02:38:42 +01:00
|
|
|
<Text mb={'0px'}>
|
|
|
|
<Link fontSize='14px' color='blue.700' fontWeight={500} textDecoration='none' href={href} target={target} _hover={{ textDecoration: 'none', color: 'purple.400' }}>
|
|
|
|
<Badge fontSize='11px' mr='7px' colorScheme={colorScheme}>{badgeText}</Badge>
|
2021-12-05 01:50:05 +01:00
|
|
|
{children}
|
2021-09-05 22:52:18 +02:00
|
|
|
</Link>
|
|
|
|
</Text>
|
2021-08-20 17:06:26 +02:00
|
|
|
);
|
|
|
|
}
|