2021-09-18 20:05:28 +03:00
|
|
|
import { Card, CardHeader, CardBody, CardFooter } from 'reactstrap';
|
2022-04-24 11:39:11 +03:00
|
|
|
import { FC, PropsWithChildren, ReactNode } from 'react';
|
2021-09-18 20:05:28 +03:00
|
|
|
import './ChartCard.scss';
|
|
|
|
|
2022-04-24 11:39:11 +03:00
|
|
|
type ChartCardProps = PropsWithChildren<{
|
2021-09-18 20:05:28 +03:00
|
|
|
title: Function | string;
|
|
|
|
footer?: ReactNode;
|
2022-04-24 11:39:11 +03:00
|
|
|
}>;
|
2021-09-18 20:05:28 +03:00
|
|
|
|
|
|
|
export const ChartCard: FC<ChartCardProps> = ({ title, footer, children }) => (
|
2022-07-11 19:26:52 +03:00
|
|
|
<Card role="document">
|
2021-09-18 20:05:28 +03:00
|
|
|
<CardHeader className="chart-card__header">{typeof title === 'function' ? title() : title}</CardHeader>
|
|
|
|
<CardBody>{children}</CardBody>
|
|
|
|
{footer && <CardFooter className="chart-card__footer--sticky">{footer}</CardFooter>}
|
|
|
|
</Card>
|
|
|
|
);
|