mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Render correct OS names globally.
This commit is contained in:
parent
784237bfab
commit
0be4a9b416
3 changed files with 25 additions and 15 deletions
|
|
@ -1,19 +1,15 @@
|
|||
import MetricsTable, { MetricsTableProps } from './MetricsTable';
|
||||
import FilterLink from 'components/common/FilterLink';
|
||||
import useMessages from 'components/hooks/useMessages';
|
||||
|
||||
const names = {
|
||||
'Mac OS': 'macOS',
|
||||
'Chrome OS': 'ChromeOS',
|
||||
'Sun OS': 'SunOS',
|
||||
};
|
||||
import useFormat from 'components/hooks/useFormat';
|
||||
|
||||
export function OSTable(props: MetricsTableProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { formatOS } = useFormat();
|
||||
|
||||
function renderLink({ x: os }) {
|
||||
return (
|
||||
<FilterLink id="os" value={names[os] || os}>
|
||||
<FilterLink id="os" value={os} label={formatOS(os)}>
|
||||
<img
|
||||
src={`${process.env.basePath || ''}/images/os/${
|
||||
os?.toLowerCase().replaceAll(/\W/g, '-') || 'unknown'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue