Files
oh-my-pi/python/robomp/web/src/components/IssueLink.tsx
T
can1357 2c773a12a4 Add 'python/robomp/' from commit '553fd1cfcf59e4c501c54fc81bc083ffd2ca007b'
git-subtree-dir: python/robomp
git-subtree-mainline: 4f6e70f779
git-subtree-split: 553fd1cfcf
2026-05-16 21:00:42 +02:00

45 lines
988 B
TypeScript

import type { JSX } from "solid-js";
import { issueUrl, prUrl } from "../format";
export interface IssueLinkProps {
repo: string;
number: number | string;
}
export function IssueLink(props: IssueLinkProps): JSX.Element {
return (
<a
class="font-mono text-[12px] text-ink-100 hover:text-accent-2"
href={issueUrl(props.repo, props.number)}
target="_blank"
rel="noopener"
>
{props.repo}
<span class="text-ink-400">#</span>
{props.number}
</a>
);
}
export interface PrLinkProps {
repo: string;
number: number | string | null | undefined;
}
export function PrLink(props: PrLinkProps): JSX.Element {
if (props.number == null || props.number === "") {
return <span class="text-ink-400">—</span>;
}
return (
<a
class="font-mono text-[12px] text-accent-2 hover:underline"
href={prUrl(props.repo, props.number)}
target="_blank"
rel="noopener"
>
#{props.number}
</a>
);
}