Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed May 13, 2024
2 parents 1ef999f + 2a024fd commit 50aa7e1
Show file tree
Hide file tree
Showing 3 changed files with 491 additions and 446 deletions.
49 changes: 49 additions & 0 deletions src/components/contentcards/CippAccordionItem.jsx
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,
}
Loading

0 comments on commit 50aa7e1

Please sign in to comment.