mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-27 03:18:22 +03:00
16 lines
551 B
TypeScript
16 lines
551 B
TypeScript
import { Card, CardHeader, CardBody, CardFooter } from 'reactstrap';
|
|
import { FC, ReactNode } from 'react';
|
|
import './ChartCard.scss';
|
|
|
|
interface ChartCardProps {
|
|
title: Function | string;
|
|
footer?: ReactNode;
|
|
}
|
|
|
|
export const ChartCard: FC<ChartCardProps> = ({ title, footer, children }) => (
|
|
<Card>
|
|
<CardHeader className="chart-card__header">{typeof title === 'function' ? title() : title}</CardHeader>
|
|
<CardBody>{children}</CardBody>
|
|
{footer && <CardFooter className="chart-card__footer--sticky">{footer}</CardFooter>}
|
|
</Card>
|
|
);
|