Files
shlink-web-client/src/utils/SimpleCard.tsx
2023-02-18 11:15:35 +01:00

16 lines
505 B
TypeScript

import type { ReactNode } from 'react';
import type { CardProps } from 'reactstrap';
import { Card, CardBody, CardHeader } from 'reactstrap';
interface SimpleCardProps extends Omit<CardProps, 'title'> {
title?: ReactNode;
bodyClassName?: string;
}
export const SimpleCard = ({ title, children, bodyClassName, ...rest }: SimpleCardProps) => (
<Card {...rest}>
{title && <CardHeader role="heading">{title}</CardHeader>}
<CardBody className={bodyClassName}>{children}</CardBody>
</Card>
);