shlink-web-client/src/utils/SimpleCard.tsx

15 lines
422 B
TypeScript
Raw Normal View History

import { CardProps } from 'reactstrap/lib/Card';
import { Card, CardBody, CardHeader } from 'reactstrap';
2020-12-12 11:43:16 +01:00
import { ReactNode } from 'react';
2020-12-12 11:43:16 +01:00
interface SimpleCardProps extends Omit<CardProps, 'title'> {
title?: ReactNode;
}
export const SimpleCard = ({ title, children, ...rest }: SimpleCardProps) => (
<Card {...rest}>
{title && <CardHeader>{title}</CardHeader>}
<CardBody>{children}</CardBody>
</Card>
);