Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
import { Row } from '@umami/react-zen';
import type { ReactNode } from 'react';
export function TypeIcon({
type,
value,
children,
}: {
type: 'browser' | 'country' | 'device' | 'os';
value: string;
children?: ReactNode;
}) {
const iconValue = type === 'browser' && value === 'browser' ? 'unknown' : value;
return (
<Row gap="3" alignItems="center">
<img
src={`${process.env.basePath || ''}/images/${type}/${
iconValue?.replaceAll(' ', '-').toLowerCase() || 'unknown'
}.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}
/>
{children}
</Row>
);
}