-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCard.tsx
More file actions
26 lines (23 loc) · 855 Bytes
/
Card.tsx
File metadata and controls
26 lines (23 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/** @jsxImportSource @emotion/react */
import { CardProvider } from './CardProvider';
import { CardContainer } from './CardContainer';
import { CardHeader } from './CardHeader';
import { CardBody } from './CardBody';
import { CardFooter } from './CardFooter';
import { CardDivider } from './CardDivider';
import { REQUIRED_CARD_PROPS } from '../constants';
import omitProps from '../utils/omitProps';
import type { CardProps } from '../types';
export const Card = ({ children, ...restProps }: CardProps) => {
const domAttributes = omitProps(restProps, REQUIRED_CARD_PROPS);
return (
<CardProvider cardProps={restProps}>
<CardContainer {...domAttributes}>{children}</CardContainer>
</CardProvider>
);
};
Card.displayName = 'Card';
Card.Header = CardHeader;
Card.Body = CardBody;
Card.Footer = CardFooter;
Card.Divider = CardDivider;