@ozen-ui/kit
Version:
React component library
21 lines (20 loc) • 1.68 kB
JavaScript
import { __assign, __rest } from "tslib";
import React from 'react';
import { useThemeProps } from '../../../../hooks/useThemeProps';
import { cn, polymorphicComponentWithRef } from '../../../../utils';
import { Indicator } from '../../../Indicator';
import { Stack } from '../../../Stack';
import { Typography } from '../../../Typography';
import { SIDEBAR_USER_ONLINE_DEFAULT_TAG, SIDEBAR_USER_ONLINE_DEFAULT_INDICATOR_VARIANT, SIDEBAR_USER_ONLINE_DEFAULT_TYPOGRAPHY_COLOR, } from './constants';
export var cnSidebarUserOnline = cn('SidebarUserOnline');
export var SidebarUserOnline = polymorphicComponentWithRef(function (inProps, ref) {
var props = useThemeProps({
props: inProps,
name: 'SidebarUserOnline',
});
var _a = props.as, as = _a === void 0 ? SIDEBAR_USER_ONLINE_DEFAULT_TAG : _a, className = props.className, _b = props.indicatorVariant, indicatorVariant = _b === void 0 ? SIDEBAR_USER_ONLINE_DEFAULT_INDICATOR_VARIANT : _b, _c = props.textColor, textColor = _c === void 0 ? SIDEBAR_USER_ONLINE_DEFAULT_TYPOGRAPHY_COLOR : _c, label = props.label, other = __rest(props, ["as", "className", "indicatorVariant", "textColor", "label"]);
return (React.createElement(Stack, __assign({}, other, { ref: ref, as: as, gap: "xs", align: "center", justify: "start", className: cnSidebarUserOnline('', [className]) }),
React.createElement(Indicator, { variant: indicatorVariant, className: cnSidebarUserOnline('Indicator'), size: "s" }),
React.createElement(Typography, { variant: "text-2xs_1", className: cnSidebarUserOnline('Label'), color: textColor, as: "span" }, label)));
});
SidebarUserOnline.displayName = 'SidebarUserOnline';