shlink-web-client/shlink-web-component/visits/charts/ChartCard.tsx

17 lines
608 B
TypeScript
Raw Normal View History

2023-02-18 12:40:37 +03:00
import type { FC, PropsWithChildren, ReactNode } from 'react';
2023-02-18 13:11:01 +03:00
import { Card, CardBody, CardFooter, CardHeader } from 'reactstrap';
import './ChartCard.scss';
type ChartCardProps = PropsWithChildren<{
title: Function | string;
footer?: ReactNode;
}>;
export const ChartCard: FC<ChartCardProps> = ({ title, footer, children }) => (
<Card role="document">
<CardHeader className="chart-card__header">{typeof title === 'function' ? title() : title}</CardHeader>
<CardBody>{children}</CardBody>
{footer && <CardFooter className="chart-card__footer--sticky">{footer}</CardFooter>}
</Card>
);