Updates to Revenue report.

This commit is contained in:
Mike Cao 2025-06-11 23:12:10 -07:00
parent 4995a0e1e4
commit 095d1f2070
19 changed files with 365 additions and 416 deletions

View file

@ -0,0 +1,34 @@
import { CURRENCIES } from '@/lib/constants';
import { ListItem, Select } from '@umami/react-zen';
import { useState } from 'react';
import { useMessages } from '@/components/hooks';
export function CurrencySelect({ value, onChange }) {
const { formatMessage, labels } = useMessages();
const [search, setSearch] = useState('');
return (
<Select
items={CURRENCIES}
label={formatMessage(labels.currency)}
value={value}
defaultValue={value}
onChange={onChange}
listProps={{ style: { maxHeight: '300px' } }}
onSearch={setSearch}
allowSearch
>
{CURRENCIES.map(({ id, name }) => {
if (search && !`${id}${name}`.toLowerCase().includes(search)) {
return null;
}
return (
<ListItem key={id} id={id}>
{id} &mdash; {name}
</ListItem>
);
}).filter(n => n)}
</Select>
);
}