1- import type { FC } from "react" ;
1+ import type { Dispatch , ReactNode , SetStateAction } from "react" ;
22import { useState } from "react" ;
33
44import ExpandMoreIcon from "@mui/icons-material/ExpandMore" ;
@@ -18,10 +18,12 @@ import {
1818 * {@label ActionsParams}
1919 */
2020export interface ActionsParams {
21- setExpanded : ( isExpanded : boolean ) => void ;
21+ [ key : string ] : unknown ;
22+ setExpanded : Dispatch < SetStateAction < boolean > > ;
2223}
2324
2425export interface BaseCardProps {
26+ children ?: ReactNode ;
2527 /**
2628 * ReactNode or Component to render in the <CardActions> component. Optional - nothing is
2729 * displayed if not passed.
@@ -30,12 +32,12 @@ export interface BaseCardProps {
3032 *
3133 * {@label actions}
3234 */
33- actions ?: React . ReactNode | ( ( actionsParams : ActionsParams ) => React . ReactNode ) ;
35+ actions ?: ReactNode | ( ( actionsParams : ActionsParams ) => ReactNode ) ;
3436 /**
3537 * ReactNode to be rendered inside the collapsed part of the card. Optional - nothing is
3638 * displayed if not passed.
3739 */
38- collapsed ?: React . ReactNode ;
40+ collapsed ?: ReactNode ;
3941 /**
4042 * Whether the card is collapsed by default. Optional. Defaults to `true`.
4143 */
@@ -65,14 +67,14 @@ export interface BaseCardProps {
6567 * * an optional collapsed view that can be enabled by default
6668 * * children are passed into the main area (unexpanded view) of the component
6769 */
68- export const BaseCard : FC < BaseCardProps > = ( {
70+ export const BaseCard = ( {
6971 children,
7072 actions,
7173 header,
7274 collapsed,
7375 keepCollapsedMounted = true ,
7476 collapsedByDefault = true ,
75- } ) => {
77+ } : BaseCardProps ) => {
7678 const [ hasExpanded , setHasExpanded ] = useState ( ! collapsedByDefault ) ;
7779 const [ expanded , setExpanded ] = useState ( ! collapsedByDefault ) ;
7880
0 commit comments