import { ReactNode } from "react";
import clsx from "clsx";

import { Icon, IconProps } from "..";

import styles from "./IconLabel.module.scss";

export type IconLabelProps = {
  iconProps: IconProps;
  children: ReactNode;
  className?: string;
};

export default function IconLabel({
  iconProps,
  children,
  className,
}: IconLabelProps) {
  return (
    <span className={clsx(styles.iconLabel, className)}>
      <Icon {...iconProps} />
      <span className={styles.label}>{children}</span>
    </span>
  );
}
