mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
feat: create CustomBox component
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Card, CardBody, CardHeader, Divider } from "@nextui-org/react";
|
||||
import React from "react";
|
||||
|
||||
interface CustomBoxProps {
|
||||
children: React.ReactNode;
|
||||
preTitle?: string;
|
||||
subTitle?: string;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
export const CustomBox = ({
|
||||
children,
|
||||
preTitle,
|
||||
subTitle,
|
||||
title,
|
||||
}: CustomBoxProps) => {
|
||||
return (
|
||||
<Card fullWidth>
|
||||
{(preTitle || subTitle || title) && (
|
||||
<>
|
||||
<CardHeader className="pt-4 pb-3 px-3 flex-col items-start">
|
||||
{preTitle && (
|
||||
<p className="text-tiny uppercase font-bold">{preTitle}</p>
|
||||
)}
|
||||
{subTitle && <small className="text-default-500">{subTitle}</small>}
|
||||
{title && <h4 className="font-bold text-large">{title}</h4>}
|
||||
</CardHeader>
|
||||
<Divider />
|
||||
</>
|
||||
)}
|
||||
<CardBody className="px-3 pt-3 pb-4">{children}</CardBody>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./CustomBox";
|
||||
Reference in New Issue
Block a user