mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
Updated reports components.
This commit is contained in:
parent
f5bc3dc6c2
commit
0f6cdf8b80
95 changed files with 580 additions and 698 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { List, ListItem, Label, Column } from '@umami/react-zen';
|
||||
import { Menu, MenuItem, Text, MenuSection } from '@umami/react-zen';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import styles from './FieldSelectForm.module.css';
|
||||
import { Key } from 'react';
|
||||
|
||||
export interface FieldSelectFormProps {
|
||||
|
|
@ -13,18 +12,17 @@ export function FieldSelectForm({ fields = [], onSelect, showType = true }: Fiel
|
|||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<Column>
|
||||
<Label>{formatMessage(labels.fields)}</Label>
|
||||
<List onSelectionChange={key => onSelect(fields[key as any])}>
|
||||
<Menu onSelectionChange={key => onSelect(fields[key as any])}>
|
||||
<MenuSection title={formatMessage(labels.fields)}>
|
||||
{fields.map(({ name, label, type }: any, index: Key) => {
|
||||
return (
|
||||
<ListItem key={index} className={styles.item}>
|
||||
<div>{label || name}</div>
|
||||
{showType && type && <div className={styles.type}>{type}</div>}
|
||||
</ListItem>
|
||||
<MenuItem key={index}>
|
||||
<Text>{label || name}</Text>
|
||||
{showType && type && <Text color="muted">{type}</Text>}
|
||||
</MenuItem>
|
||||
);
|
||||
})}
|
||||
</List>
|
||||
</Column>
|
||||
</MenuSection>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue