refactor(web): remove typescript
This commit is contained in:
@@ -10,27 +10,15 @@ 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 'types';
|
||||
import TrialOverAlert from 'components/TrialOverAlert/index.ee';
|
||||
import SubscriptionCancelledAlert from 'components/SubscriptionCancelledAlert/index.ee';
|
||||
import CheckoutCompletedAlert from 'components/CheckoutCompletedAlert/index.ee';
|
||||
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 capitalize = (str) => str[0].toUpperCase() + str.slice(1, str.length);
|
||||
function BillingCard(props) {
|
||||
const { name, title = '', action } = props;
|
||||
|
||||
return (
|
||||
<Card
|
||||
sx={{
|
||||
@@ -57,13 +45,10 @@ function BillingCard(props: BillingCardProps) {
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
function Action(props: { action?: TBillingCardAction }) {
|
||||
function Action(props) {
|
||||
const { action } = props;
|
||||
if (!action) return <React.Fragment />;
|
||||
|
||||
const { text, type } = action;
|
||||
|
||||
if (type === 'link') {
|
||||
if (action.src.startsWith('http')) {
|
||||
return (
|
||||
@@ -79,7 +64,6 @@ function Action(props: { action?: TBillingCardAction }) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (type === 'text') {
|
||||
return (
|
||||
<Typography variant="subtitle2" pb={1}>
|
||||
@@ -87,14 +71,11 @@ function Action(props: { action?: TBillingCardAction }) {
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
|
||||
return <React.Fragment />;
|
||||
}
|
||||
|
||||
export default function UsageDataInformation() {
|
||||
const formatMessage = useFormatMessage();
|
||||
const billingAndUsageData = useBillingAndUsageData();
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Stack sx={{ width: '100%', mb: 2 }} spacing={2}>
|
Reference in New Issue
Block a user