mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 03:25:40 +01:00
Event data report UI.
This commit is contained in:
parent
6316a0b917
commit
9d7862cbd6
36 changed files with 660 additions and 254 deletions
33
components/pages/reports/ParameterList.js
Normal file
33
components/pages/reports/ParameterList.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { Icon, Text, TooltipPopup } from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
import Empty from 'components/common/Empty';
|
||||
import { useMessages } from 'hooks';
|
||||
import styles from './ParameterList.module.css';
|
||||
|
||||
export function ParameterList({ items = [], children, onRemove }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<div className={styles.list}>
|
||||
{!items.length && <Empty message={formatMessage(labels.none)} />}
|
||||
{items.map((item, index) => {
|
||||
return (
|
||||
<div key={index} className={styles.item}>
|
||||
<Text>{typeof children === 'function' ? children(item) : item}</Text>
|
||||
<TooltipPopup
|
||||
className={styles.icon}
|
||||
label={formatMessage(labels.remove)}
|
||||
position="right"
|
||||
>
|
||||
<Icon onClick={onRemove.bind(null, index)}>
|
||||
<Icons.Close />
|
||||
</Icon>
|
||||
</TooltipPopup>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ParameterList;
|
||||
Loading…
Add table
Add a link
Reference in a new issue