mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 14:55:19 +00:00
Co-authored-by: adamdotdevin <2363879+adamdottv@users.noreply.github.com> Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com>
16 lines
582 B
TypeScript
16 lines
582 B
TypeScript
import { A } from "@solidjs/router"
|
|
import { splitProps } from "solid-js"
|
|
import type { ComponentProps } from "solid-js"
|
|
import { getButtonClasses } from "./button"
|
|
|
|
export interface LinkProps extends ComponentProps<typeof A> {
|
|
variant?: "primary" | "secondary" | "outline" | "ghost"
|
|
size?: "sm" | "md" | "lg"
|
|
}
|
|
|
|
export function Link(props: LinkProps) {
|
|
const [local, others] = splitProps(props, ["variant", "size", "class"])
|
|
const classes = local.variant ? getButtonClasses(local.variant, local.size, local.class) : local.class
|
|
return <A class={classes} {...others} />
|
|
}
|