|
|
@ -12,6 +12,7 @@ import InnerPanel from './InnerPanel'; |
|
|
|
import InnerPanelBody from './InnerPanelBody'; |
|
|
|
import InnerPanelBody from './InnerPanelBody'; |
|
|
|
import InnerPanelHeader from './InnerPanelHeader'; |
|
|
|
import InnerPanelHeader from './InnerPanelHeader'; |
|
|
|
import Spinner from '../Spinner'; |
|
|
|
import Spinner from '../Spinner'; |
|
|
|
|
|
|
|
import { BodyText } from '../Text'; |
|
|
|
|
|
|
|
|
|
|
|
type ExpandablePanelOptionalProps = { |
|
|
|
type ExpandablePanelOptionalProps = { |
|
|
|
expandInitially?: boolean; |
|
|
|
expandInitially?: boolean; |
|
|
@ -46,6 +47,10 @@ const ExpandablePanel: FC<ExpandablePanelProps> = ({ |
|
|
|
[isExpand], |
|
|
|
[isExpand], |
|
|
|
); |
|
|
|
); |
|
|
|
const contentHeight = useMemo(() => (isExpand ? 'auto' : '.2em'), [isExpand]); |
|
|
|
const contentHeight = useMemo(() => (isExpand ? 'auto' : '.2em'), [isExpand]); |
|
|
|
|
|
|
|
const headerElement = useMemo( |
|
|
|
|
|
|
|
() => (typeof header === 'string' ? <BodyText>{header}</BodyText> : header), |
|
|
|
|
|
|
|
[header], |
|
|
|
|
|
|
|
); |
|
|
|
const headerSpinner = useMemo( |
|
|
|
const headerSpinner = useMemo( |
|
|
|
() => |
|
|
|
() => |
|
|
|
isShowHeaderSpinner && !isExpand && isLoading ? ( |
|
|
|
isShowHeaderSpinner && !isExpand && isLoading ? ( |
|
|
@ -74,7 +79,7 @@ const ExpandablePanel: FC<ExpandablePanelProps> = ({ |
|
|
|
<InnerPanel> |
|
|
|
<InnerPanel> |
|
|
|
<InnerPanelHeader> |
|
|
|
<InnerPanelHeader> |
|
|
|
<FlexBox row> |
|
|
|
<FlexBox row> |
|
|
|
{header} |
|
|
|
{headerElement} |
|
|
|
{headerSpinner} |
|
|
|
{headerSpinner} |
|
|
|
</FlexBox> |
|
|
|
</FlexBox> |
|
|
|
<IconButton |
|
|
|
<IconButton |
|
|
|