Skip to content

Commit

Permalink
feat(web): display image credits in image tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov committed Sep 28, 2023
1 parent 0e7b1bf commit d769ca0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages_rs/nextclade-web/src/components/Main/DatasetInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export interface DatasetInfoCircleProps {
}

function DatasetInfoAutodetectProgressCircle({ dataset, showSuggestions }: DatasetInfoCircleProps) {
const { t } = useTranslationSafe()
const { attributes, path, image } = dataset
const { name } = attributes

Expand Down Expand Up @@ -221,10 +222,11 @@ function DatasetInfoAutodetectProgressCircle({ dataset, showSuggestions }: Datas

const circle = useMemo(() => {
if (image?.path) {
return <CircleImage $bg={circleBg} $image={image.path} />
const title = image?.source ? t('Image credits: {{source}}', { source: image.source }) : undefined
return <CircleImage $bg={circleBg} $image={image.path} title={title} />
}
return <Circle $bg={circleBg}>{circleText}</Circle>
}, [circleBg, circleText, image?.path])
}, [circleBg, circleText, image?.path, image?.source, t])

return (
<>
Expand Down

0 comments on commit d769ca0

Please sign in to comment.