@@ -4,20 +4,20 @@ import { getClassName } from '@react-devui/utils';
44
55import { registerComponentMate } from '../../utils' ;
66import { useComponentConfig , usePrefixConfig } from '../root' ;
7- import { DSeparator } from '../separator' ;
87import { DCardAction } from './CardAction' ;
8+ import { DCardActions } from './CardActions' ;
99import { DCardContent } from './CardContent' ;
1010import { DCardHeader } from './CardHeader' ;
1111
1212export interface DCardProps extends React . HTMLAttributes < HTMLDivElement > {
1313 dBorder ?: boolean ;
1414 dShadow ?: boolean | 'hover' ;
15- dActions ?: React . ReactNode [ ] ;
1615}
1716
1817const { COMPONENT_NAME } = registerComponentMate ( { COMPONENT_NAME : 'DCard' as const } ) ;
1918export const DCard : {
2019 ( props : DCardProps ) : JSX . Element | null ;
20+ Actions : typeof DCardActions ;
2121 Action : typeof DCardAction ;
2222 Header : typeof DCardHeader ;
2323 Content : typeof DCardContent ;
@@ -26,7 +26,6 @@ export const DCard: {
2626 children,
2727 dBorder = true ,
2828 dShadow = false ,
29- dActions,
3029
3130 ...restProps
3231 } = useComponentConfig ( COMPONENT_NAME , props ) ;
@@ -45,20 +44,11 @@ export const DCard: {
4544 } ) }
4645 >
4746 { children }
48- { dActions && (
49- < div className = { `${ dPrefix } card__actions` } >
50- { React . Children . map ( dActions , ( action , index ) => (
51- < >
52- { action }
53- { index !== dActions . length - 1 && < DSeparator style = { { margin : 8 } } dVertical > </ DSeparator > }
54- </ >
55- ) ) }
56- </ div >
57- ) }
5847 </ div >
5948 ) ;
6049} ;
6150
51+ DCard . Actions = DCardActions ;
6252DCard . Action = DCardAction ;
6353DCard . Header = DCardHeader ;
6454DCard . Content = DCardContent ;
0 commit comments