mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Added useFormat hook to format special values.
This commit is contained in:
parent
a71cf675ae
commit
2eee9c23c3
9 changed files with 68 additions and 19 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import { useRouter } from 'next/router';
|
||||
import FilterLink from 'components/common/FilterLink';
|
||||
import useCountryNames from 'hooks/useCountryNames';
|
||||
import useLocale from 'hooks/useLocale';
|
||||
import useMessages from 'hooks/useMessages';
|
||||
import { useLocale, useMessages, useFormat } from 'hooks';
|
||||
import MetricsTable from './MetricsTable';
|
||||
|
||||
export function CountriesTable({ websiteId, ...props }) {
|
||||
|
|
@ -10,6 +9,7 @@ export function CountriesTable({ websiteId, ...props }) {
|
|||
const countryNames = useCountryNames(locale);
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { basePath } = useRouter();
|
||||
const { formatCountry } = useFormat();
|
||||
|
||||
function renderLink({ x: code }) {
|
||||
return (
|
||||
|
|
@ -17,7 +17,7 @@ export function CountriesTable({ websiteId, ...props }) {
|
|||
id="country"
|
||||
className={locale}
|
||||
value={countryNames[code] && code}
|
||||
label={countryNames[code]}
|
||||
label={formatCountry(code)}
|
||||
>
|
||||
<img src={`${basePath}/images/flags/${code?.toLowerCase() || 'xx'}.png`} alt={code} />
|
||||
</FilterLink>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue