mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
fix unknown icon and country render link
This commit is contained in:
parent
d15bc58a1d
commit
b61e14962a
4 changed files with 21 additions and 39 deletions
|
|
@ -12,9 +12,12 @@ export function TypeIcon({
|
|||
return (
|
||||
<>
|
||||
<img
|
||||
src={`${process.env.basePath || ''}/images/${type}/${
|
||||
value?.replaceAll(' ', '-').toLowerCase() || 'unknown'
|
||||
}.png`}
|
||||
src={`${process.env.basePath || ''}/images/${type}/${value
|
||||
?.replaceAll(' ', '-')
|
||||
.toLowerCase()}.png`}
|
||||
onError={e => {
|
||||
e.currentTarget.src = `${process.env.basePath || ''}/images/${type}/unknown.png`;
|
||||
}}
|
||||
alt={value}
|
||||
width={type === 'country' ? undefined : 16}
|
||||
height={type === 'country' ? undefined : 16}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ export function CountriesTable({ ...props }: MetricsTableProps) {
|
|||
|
||||
const renderLink = ({ x: code }) => {
|
||||
return (
|
||||
<FilterLink id="country" value={countryNames[code] && code} label={formatCountry(code)}>
|
||||
<FilterLink
|
||||
id="country"
|
||||
value={(countryNames[code] && code) || code}
|
||||
label={formatCountry(code)}
|
||||
>
|
||||
<TypeIcon type="country" value={code?.toLowerCase()} />
|
||||
</FilterLink>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue