mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
44 lines
985 B
TypeScript
44 lines
985 B
TypeScript
import { InfoIcon, LinkExternalIcon } from '@primer/octicons-react'
|
|
import { Box } from '@primer/react'
|
|
import React from 'react'
|
|
import { ConfigKeys } from 'utils/config/helper'
|
|
import { SimpleConfigField } from '.'
|
|
|
|
export function FieldLabel<Key extends ConfigKeys>({
|
|
label,
|
|
wikiLink,
|
|
tooltip,
|
|
}: SimpleConfigField<Key>) {
|
|
return (
|
|
<>
|
|
{label}
|
|
{(wikiLink || tooltip) && ' '}
|
|
{wikiLink ? (
|
|
<a
|
|
className={'help'}
|
|
href={wikiLink}
|
|
title={tooltip}
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
>
|
|
<LinkExternalIcon size="small" />
|
|
</a>
|
|
) : (
|
|
tooltip && (
|
|
<Box
|
|
as="span"
|
|
sx={{
|
|
'.octicon': {
|
|
color: 'fg.subtle',
|
|
},
|
|
}}
|
|
className={'help'}
|
|
title={tooltip}
|
|
>
|
|
<InfoIcon size="small" />
|
|
</Box>
|
|
)
|
|
)}
|
|
</>
|
|
)
|
|
}
|