forked from inventree/InvenTree
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PUI] Add currency stats (inventree#7971)
* factor out stats overview * move to panel * Add currency stas overview Closes invenhost#115
- Loading branch information
Showing
5 changed files
with
78 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { SimpleGrid } from '@mantine/core'; | ||
|
||
import { FactItem } from './FactItem'; | ||
|
||
export function FactCollection({ | ||
items, | ||
minItems = 3 | ||
}: { | ||
items: { title: string; value: any }[]; | ||
minItems?: number; | ||
}) { | ||
return ( | ||
<SimpleGrid cols={minItems} spacing="xs"> | ||
{items.map((item, index) => ( | ||
<FactItem key={index} title={item.title} value={item.value} /> | ||
))} | ||
</SimpleGrid> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Paper, Stack, Text } from '@mantine/core'; | ||
|
||
import { StylishText } from '../items/StylishText'; | ||
|
||
export function FactItem({ title, value }: { title: string; value: number }) { | ||
return ( | ||
<Paper p="md" shadow="xs"> | ||
<Stack gap="xs"> | ||
<StylishText size="md">{title}</StylishText> | ||
<Text>{value}</Text> | ||
</Stack> | ||
</Paper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters