feat: ability to remove spacing
This commit is contained in:
@ -3,16 +3,29 @@ import type { FC, ReactNode } from "react";
|
|||||||
interface ComponentProps {
|
interface ComponentProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
spacing?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Card: FC<ComponentProps> = ({ children, className }) => {
|
export const Card: FC<ComponentProps> = ({ children, className }) => {
|
||||||
return (
|
return (
|
||||||
<div className={`bg-white sm:rounded-lg shadow-md ${className || ""}`}>
|
<div
|
||||||
|
className={`bg-white sm:rounded-lg overflow-hidden shadow-md ${
|
||||||
|
className || ""
|
||||||
|
}`}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export function CardContent({ children, className }: ComponentProps) {
|
export function CardContent({
|
||||||
return <div className={`p-4 ${className || ""}`}>{children}</div>;
|
children,
|
||||||
|
className,
|
||||||
|
spacing = true,
|
||||||
|
}: ComponentProps) {
|
||||||
|
return (
|
||||||
|
<div className={`${spacing ? "p-4 " : ""}${className || ""}`}>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user