Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

698 B
Raw Blame
import { Icon, type IconProps, Row, type RowProps, Text, type TextProps } from '@umami/react-zen';
import type { ReactNode } from 'react';

interface IconLabelProps extends RowProps {
  icon: ReactNode;
  label?: ReactNode;
  weight?: TextProps['weight'];
  iconProps?: Partial<IconProps>;
  labelProps?: Partial<TextProps>;
}

export function IconLabel({
  icon,
  label,
  weight,
  iconProps,
  labelProps,
  children,
  ...props
}: IconLabelProps) {
  return (
    <Row alignItems="center" gap="2" {...props}>
      <Icon {...iconProps}>{icon}</Icon>
      {label && (
        <Text weight={weight} {...labelProps}>
          {label}
        </Text>
      )}
      {children}
    </Row>
  );
}