mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:11:48 +00:00
29 lines
739 B
TypeScript
29 lines
739 B
TypeScript
import { Link } from '@sourcegraph/wildcard'
|
|
|
|
import { ExternalServiceKind } from '../../graphql-operations'
|
|
import { Linkified } from '../linkifiy/Linkified'
|
|
|
|
interface Props {
|
|
message: string
|
|
to: string
|
|
className: string
|
|
onClick?: () => void
|
|
externalURLs: { url: string; serviceKind: ExternalServiceKind | null }[] | undefined
|
|
}
|
|
export const CommitMessageWithLinks = ({
|
|
message,
|
|
to,
|
|
className,
|
|
onClick,
|
|
externalURLs,
|
|
}: Props): React.ReactElement => {
|
|
const commitLinkProps = {
|
|
'data-testid': 'git-commit-node-message-subject',
|
|
className,
|
|
onClick,
|
|
to,
|
|
}
|
|
|
|
return <Linkified input={message} externalURLs={externalURLs} as={Link} {...commitLinkProps} />
|
|
}
|