diff --git a/packages/web/src/components/Invoices/index.ee.tsx b/packages/web/src/components/Invoices/index.ee.tsx new file mode 100644 index 00000000..09f2a671 --- /dev/null +++ b/packages/web/src/components/Invoices/index.ee.tsx @@ -0,0 +1,191 @@ +import * as React from 'react'; +import { Link } from 'react-router-dom'; +import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; +import Chip from '@mui/material/Chip'; +import Card from '@mui/material/Card'; +import CardActions from '@mui/material/CardActions'; +import CardContent from '@mui/material/CardContent'; +import Divider from '@mui/material/Divider'; +import Grid from '@mui/material/Grid'; +import Typography from '@mui/material/Typography'; + +import { TBillingCardAction } from '@automatisch/types'; +import * as URLS from 'config/urls'; +import useBillingAndUsageData from 'hooks/useBillingAndUsageData.ee'; +import useFormatMessage from 'hooks/useFormatMessage'; + +const capitalize = (str: string) => + str[0].toUpperCase() + str.slice(1, str.length); + +type BillingCardProps = { + name: string; + title?: string; + action?: TBillingCardAction; +}; + +function BillingCard(props: BillingCardProps) { + const { name, title = '', action } = props; + + return ( + theme.palette.background.default, + }} + > + + + {name} + + + + {title} + + + + + + + + ); +} + +function Action(props: { action?: TBillingCardAction }) { + const { action } = props; + if (!action) return ; + + const { text, type } = action; + + if (type === 'link') { + if (action.src.startsWith('http')) { + return ( + + ); + } else { + return ( + + ); + } + } + + if (type === 'text') { + return ( + + {text} + + ); + } + + return ; +} + +export default function Invoices() { + const formatMessage = useFormatMessage(); + const billingAndUsageData = useBillingAndUsageData(); + + return ( + + + + + + Invoices + + + + + + + + + Date + + + + + + Amount + + + + + + Invoice + + + + + + + + + Mar 16, 2023 + + + + + €20.00 + + + + + + Link + + + + + + + + + + Mar 16, 2023 + + + + + €20.00 + + + + + Link + + + + + + + ); +} diff --git a/packages/web/src/pages/BillingAndUsageSettings/index.ee.tsx b/packages/web/src/pages/BillingAndUsageSettings/index.ee.tsx index 62a7de4f..73da9c29 100644 --- a/packages/web/src/pages/BillingAndUsageSettings/index.ee.tsx +++ b/packages/web/src/pages/BillingAndUsageSettings/index.ee.tsx @@ -4,6 +4,7 @@ import Grid from '@mui/material/Grid'; import * as URLS from 'config/urls'; import UsageDataInformation from 'components/UsageDataInformation/index.ee'; +import Invoices from 'components/Invoices/index.ee'; import PageTitle from 'components/PageTitle'; import Container from 'components/Container'; import useFormatMessage from 'hooks/useFormatMessage'; @@ -34,6 +35,10 @@ function BillingAndUsageSettings() { + + + + );