UNPKG

@ozen-ui/kit

Version:

React component library

15 lines (14 loc) 1.05 kB
import { __assign, __rest } from "tslib"; import React from 'react'; import { cn } from '../../../../utils/classname'; import { polymorphicComponentWithRef } from '../../../../utils/polymorphicComponentWithRef'; import { Stack } from '../../../Stack'; import { useDataListCardContext } from '../../DataListCardContext'; import { DATA_LIST_CARD_STATUS_DEFAULT_TAG, DATA_LIST_CARD_STATUS_GAP_BY_SIZE, } from './constants'; export var cnDataListCardStatus = cn('DataListCardStatus'); export var DataListCardStatus = polymorphicComponentWithRef(function (_a, ref) { var children = _a.children, className = _a.className, _b = _a.as, as = _b === void 0 ? DATA_LIST_CARD_STATUS_DEFAULT_TAG : _b, other = __rest(_a, ["children", "className", "as"]); var size = useDataListCardContext().size; return (React.createElement(Stack, __assign({ gap: DATA_LIST_CARD_STATUS_GAP_BY_SIZE[size] }, other, { ref: ref, as: as, className: cnDataListCardStatus({ size: size }, [className]) }), children)); }); DataListCardStatus.displayName = 'DataListCardStatus';