forked from KelvinTegelaar/CIPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6d09ef
commit 268abe5
Showing
3 changed files
with
491 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react' | ||
import { | ||
CAccordionBody, | ||
CAccordionHeader, | ||
CAccordionItem, | ||
CCard, | ||
CCardBody, | ||
CCardFooter, | ||
CCardHeader, | ||
CCardTitle, | ||
} from '@coreui/react' | ||
import Skeleton from 'react-loading-skeleton' | ||
import PropTypes from 'prop-types' | ||
|
||
export default function CippAccordionItem({ | ||
title, | ||
titleType = 'normal', | ||
CardButton, | ||
children, | ||
isFetching, | ||
}) { | ||
return ( | ||
<CAccordionItem> | ||
<CAccordionHeader>{title}</CAccordionHeader> | ||
<CAccordionBody> | ||
<CCard> | ||
<CCardHeader> | ||
<CCardTitle> | ||
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title} | ||
</CCardTitle> | ||
</CCardHeader> | ||
<CCardBody className="my-3"> | ||
{isFetching && <Skeleton />} | ||
{children} | ||
</CCardBody> | ||
<CCardFooter>{CardButton}</CCardFooter> | ||
</CCard> | ||
</CAccordionBody> | ||
</CAccordionItem> | ||
) | ||
} | ||
|
||
CippAccordionItem.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
titleType: PropTypes.string, | ||
CardButton: PropTypes.element.isRequired, | ||
children: PropTypes.element.isRequired, | ||
isFetching: PropTypes.bool.isRequired, | ||
} |
Oops, something went wrong.