1 | import classNames from 'classnames';
|
2 | import * as React from 'react';
|
3 | import { useMemo } from 'react';
|
4 | import { useBootstrapPrefix } from './ThemeProvider';
|
5 | import CardHeaderContext from './CardHeaderContext';
|
6 | import { jsx as _jsx } from "react/jsx-runtime";
|
7 | const CardHeader = React.forwardRef(({
|
8 | bsPrefix,
|
9 | className,
|
10 |
|
11 | as: Component = 'div',
|
12 | ...props
|
13 | }, ref) => {
|
14 | const prefix = useBootstrapPrefix(bsPrefix, 'card-header');
|
15 | const contextValue = useMemo(() => ({
|
16 | cardHeaderBsPrefix: prefix
|
17 | }), [prefix]);
|
18 | return _jsx(CardHeaderContext.Provider, {
|
19 | value: contextValue,
|
20 | children: _jsx(Component, {
|
21 | ref: ref,
|
22 | ...props,
|
23 | className: classNames(className, prefix)
|
24 | })
|
25 | });
|
26 | });
|
27 | CardHeader.displayName = 'CardHeader';
|
28 | export default CardHeader; |
\ | No newline at end of file |