bring over most of the things

This commit is contained in:
MapleLeaf
2022-01-02 16:35:03 -06:00
committed by Darius
parent aa27623d11
commit 336e680b6e
23 changed files with 738 additions and 76 deletions

View File

@@ -0,0 +1,34 @@
import { Link } from "react-router-dom"
import { ExternalLink } from "./external-link"
export type AppLinkProps = {
type: "router" | "internal" | "external"
label: React.ReactNode
to: string
className?: string
}
export function AppLink(props: AppLinkProps) {
switch (props.type) {
case "router":
return (
<Link className={props.className} to={props.to}>
{props.label}
</Link>
)
case "internal":
return (
<a className={props.className} href={props.to}>
{props.label}
</a>
)
case "external":
return (
<ExternalLink className={props.className} href={props.to}>
{props.label}
</ExternalLink>
)
}
}