mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 01:05:58 +02:00
24 lines
459 B
TypeScript
24 lines
459 B
TypeScript
import React, { FC } from "react"
|
|
import * as SC from "./styles"
|
|
|
|
interface IResourcesLinkProps {
|
|
to: string
|
|
}
|
|
|
|
export const ResourcesLink: FC<IResourcesLinkProps> = ({
|
|
children,
|
|
to,
|
|
}) => {
|
|
if (!to.match(/^(https?:\/\/)/)) {
|
|
return (
|
|
<SC.ResourcesLinkInternal to={to}>{children}</SC.ResourcesLinkInternal>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<SC.ResourcesLinkExternal href={to} target="_blank">
|
|
{children}
|
|
</SC.ResourcesLinkExternal>
|
|
)
|
|
}
|