Files
developer-roadmap/components/md-renderer/mdx-components/badge-link.tsx

22 lines
571 B
TypeScript
Raw Normal View History

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;
children: React.ReactNode
};
export function BadgeLink(props: BadgeLinkType) {
2021-09-05 22:52:18 +02:00
const { target = '_blank', badgeText, href, children } = props;
2021-08-20 17:06:26 +02:00
return (
2021-09-05 22:52:18 +02:00
<Text mb={0}>
<Link fontWeight={500} textDecoration='underline' href={href} target={target}>
<Badge colorScheme={'purple'} style={{ position: 'relative', top: '-2px' }}>{badgeText}</Badge> {children}
</Link>
</Text>
2021-08-20 17:06:26 +02:00
);
}