mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
* types: export components SemanticName type * update * update * update * update * update
28 lines
864 B
TypeScript
28 lines
864 B
TypeScript
import * as React from 'react';
|
|
import { clsx } from 'clsx';
|
|
|
|
import { ConfigContext } from '../config-provider';
|
|
import type { ConfigConsumerProps } from '../config-provider';
|
|
|
|
export interface CardGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
prefixCls?: string;
|
|
className?: string;
|
|
hoverable?: boolean;
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
const CardGrid: React.FC<CardGridProps> = ({ prefixCls, className, hoverable = true, ...rest }) => {
|
|
const { getPrefixCls } = React.useContext<ConfigConsumerProps>(ConfigContext);
|
|
const prefix = getPrefixCls('card', prefixCls);
|
|
const classString = clsx(`${prefix}-grid`, className, {
|
|
[`${prefix}-grid-hoverable`]: hoverable,
|
|
});
|
|
return <div {...rest} className={classString} />;
|
|
};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
CardGrid.displayName = 'CardGrid';
|
|
}
|
|
|
|
export default CardGrid;
|