mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 20:26:40 +00:00
Created SimpleCard component to reduce duplicated code when rendering cards
This commit is contained in:
13
src/utils/SimpleCard.tsx
Normal file
13
src/utils/SimpleCard.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CardProps } from 'reactstrap/lib/Card';
|
||||
import { Card, CardBody, CardHeader } from 'reactstrap';
|
||||
|
||||
interface SimpleCardProps extends CardProps {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
export const SimpleCard = ({ title, children, ...rest }: SimpleCardProps) => (
|
||||
<Card {...rest}>
|
||||
{title && <CardHeader>{title}</CardHeader>}
|
||||
<CardBody>{children}</CardBody>
|
||||
</Card>
|
||||
);
|
||||
Reference in New Issue
Block a user