mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-13 22:42:38 -05:00
29 lines
630 B
TypeScript
29 lines
630 B
TypeScript
import { Link as ChakraLink } from "@chakra-ui/react";
|
|
import { useMyTheme } from "lib/useMyTheme";
|
|
import NextLink from "next/link";
|
|
|
|
interface Props {
|
|
children: React.ReactNode;
|
|
href: string;
|
|
isExternal?: boolean;
|
|
}
|
|
|
|
const MyLink: React.FC<Props> = ({ children, href, isExternal }) => {
|
|
const { themeColorShade } = useMyTheme();
|
|
|
|
if (isExternal) {
|
|
return (
|
|
<ChakraLink href={href} color={themeColorShade}>
|
|
{children}
|
|
</ChakraLink>
|
|
);
|
|
}
|
|
return (
|
|
<NextLink href={href}>
|
|
<ChakraLink color={themeColorShade}>{children}</ChakraLink>
|
|
</NextLink>
|
|
);
|
|
};
|
|
|
|
export default MyLink;
|