mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-04-02 11:03:35 +03:00
21 lines
682 B
TypeScript
21 lines
682 B
TypeScript
import { Card, CardHeader, CardBody, CardFooter } from 'reactstrap';
|
|
import { ReactNode } from 'react';
|
|
import DefaultChart, { DefaultChartProps } from './DefaultChart';
|
|
import './GraphCard.scss';
|
|
|
|
interface GraphCardProps extends DefaultChartProps {
|
|
title: Function | string;
|
|
footer?: ReactNode;
|
|
}
|
|
|
|
const GraphCard = ({ title, footer, ...rest }: GraphCardProps) => (
|
|
<Card>
|
|
<CardHeader className="graph-card__header">{typeof title === 'function' ? title() : title}</CardHeader>
|
|
<CardBody>
|
|
<DefaultChart {...rest} />
|
|
</CardBody>
|
|
{footer && <CardFooter className="graph-card__footer--sticky">{footer}</CardFooter>}
|
|
</Card>
|
|
);
|
|
|
|
export default GraphCard;
|