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

15 lines
451 B
TypeScript
Raw Normal View History

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