mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-07-30 15:41:51 +00:00
Refactored components used to render charts for visits
This commit is contained in:
16
src/visits/charts/ChartCard.tsx
Normal file
16
src/visits/charts/ChartCard.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
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>
|
||||
);
|
||||
Reference in New Issue
Block a user