MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / IconComponent

Function IconComponent

packages/ui-default/components/react/IconComponent.tsx:5–15  ·  view source on GitHub ↗
(props: { name: string, className?: string } & React.HTMLAttributes<HTMLSpanElement>)

Source from the content-addressed store, hash-verified

3import React from 'react';
4
5export default function IconComponent(props: { name: string, className?: string } & React.HTMLAttributes<HTMLSpanElement>) {
6 const {
7 name,
8 className,
9 ...rest
10 } = props;
11 const cn = classNames(className, `icon icon-${name}`);
12 return (
13 <span {...rest} className={cn} />
14 );
15}
16
17IconComponent.propTypes = {
18 name: PropTypes.string.isRequired,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected