Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions packages/opencode/src/cli/cmd/tui/ui/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@ export interface LinkProps {
fg?: RGBA
}

/**
* 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}
onMouseUp={() => {
open(props.href).catch(() => {})
}}
>
{displayText}
<a href={props.href} style={{ fg: props.fg }}>
{displayText}
</a>
</text>
)
}