gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/common/components/entity-field-card/index.tsx · v0.7.4
Source
1 db68a58 Dawsh 2y ago import { LucideIcon } from 'lucide-react';
2 7389ad0 Mardin 2y ago import { Label, Separator } from '@marzneshin/common/components';
3 db68a58 Dawsh 2y ago import { FC } from 'react'
4 db68a58 Dawsh 2y ago
5 db68a58 Dawsh 2y ago interface EntityFieldCardProps {
6 db68a58 Dawsh 2y ago FirstIcon: LucideIcon;
7 db68a58 Dawsh 2y ago SecondIcon: LucideIcon;
8 db68a58 Dawsh 2y ago firstAmount: number | string;
9 db68a58 Dawsh 2y ago secondAmount: number | string;
10 db68a58 Dawsh 2y ago name: string;
11 db68a58 Dawsh 2y ago }
12 db68a58 Dawsh 2y ago
13 db68a58 Dawsh 2y ago
14 db68a58 Dawsh 2y ago export const EntityCardProperty = ({ Icon, amount }: { Icon: LucideIcon, amount: number | string }) => (
15 db68a58 Dawsh 2y ago <div className="flex flex-row items-center w-full">
16 db68a58 Dawsh 2y ago <Icon className="w-4 h-4 font-light mr-1" />
17 db68a58 Dawsh 2y ago {amount}
18 db68a58 Dawsh 2y ago </div>
19 db68a58 Dawsh 2y ago )
20 db68a58 Dawsh 2y ago
21 db68a58 Dawsh 2y ago export const EntityFieldCard: FC<EntityFieldCardProps> = (
22 db68a58 Dawsh 2y ago { FirstIcon, SecondIcon, firstAmount, secondAmount, name }
23 db68a58 Dawsh 2y ago ) => {
24 db68a58 Dawsh 2y ago return (
25 db68a58 Dawsh 2y ago <div className="w-full flex justify-between flex-row items-center">
26 db68a58 Dawsh 2y ago <Label>{name}</Label>
27 db68a58 Dawsh 2y ago <div className="flex flex-row items-center gap-1">
28 db68a58 Dawsh 2y ago <EntityCardProperty Icon={FirstIcon} amount={firstAmount} />
29 db68a58 Dawsh 2y ago <Separator className="w-4 rotate-[-75deg]" />
30 db68a58 Dawsh 2y ago <EntityCardProperty Icon={SecondIcon} amount={secondAmount} />
31 db68a58 Dawsh 2y ago </div>
32 db68a58 Dawsh 2y ago </div>
33 db68a58 Dawsh 2y ago )
34 db68a58 Dawsh 2y ago };