docs -> website

This commit is contained in:
MapleLeaf
2022-01-11 00:24:02 -06:00
parent effd16ed97
commit 6b77971ed5
47 changed files with 64 additions and 65 deletions

View File

@@ -0,0 +1,31 @@
import type { ComponentPropsWithoutRef } from "react"
import { Link } from "remix"
export type AppLinkProps = ComponentPropsWithoutRef<"a"> & {
type: "internal" | "external" | "router"
to: string
}
export function AppLink({ type, to, children, ...props }: AppLinkProps) {
if (type === "internal") {
return (
<a href={to} {...props}>
{children}
</a>
)
}
if (type === "external") {
return (
<a href={to} target="_blank" rel="noopener noreferrer" {...props}>
{children}
</a>
)
}
return (
<Link to={to} {...props}>
{children}
</Link>
)
}