GHHG10's picture
download
raw
746 Bytes
import type { JSX } from "solid-js"
import type { RGBA } from "@opentui/core"
import open from "open"
export interface LinkProps {
href: string
children?: JSX.Element | string
fg?: RGBA
bg?: RGBA
width?: number | "auto" | `${number}%`
wrapMode?: "word" | "none"
}
/**
* Link component that renders clickable hyperlinks.
* Clicking anywhere on the link text opens the URL in the default browser.
*/
export function Link(props: LinkProps) {
const displayText = props.children ?? props.href
return (
<text
fg={props.fg}
bg={props.bg}
width={props.width}
wrapMode={props.wrapMode}
onMouseUp={() => {
open(props.href).catch(() => {})
}}
>
{displayText}
</text>
)
}

Xet Storage Details

Size:
746 Bytes
·
Xet hash:
c265164fdb65ff88ca259104cf11e157783f6f5f4f2f970c47cb5efdb1e53d78

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.