mirror of
https://github.com/hanzoai/o11y-icons.git
synced 2026-11-03 02:09:25 +00:00
72 lines
2.3 KiB
TypeScript
72 lines
2.3 KiB
TypeScript
import type React from 'react';
|
|
import { cloneElement } from 'react';
|
|
import type { IconSize } from '../icon-config.js';
|
|
import { ICON_SIZE_MAP, STROKE_WIDTH_MAP } from '../icon-config.js';
|
|
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
size?: IconSize | number;
|
|
strokeWidth?: number;
|
|
className?: string;
|
|
}
|
|
const SvgFeedbackMegaphone = ({
|
|
color = 'currentColor',
|
|
size,
|
|
strokeWidth,
|
|
className,
|
|
...props
|
|
}: IconProps): React.ReactElement => {
|
|
const element = (
|
|
<svg width={16} height={16} fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
<path
|
|
d="M13.75 6.414c0 2.164-1.11 4.164-2.181 4.164s-2.181-2-2.181-4.164c0-2.165 1.11-4.164 2.18-4.164 1.071 0 2.182 2 2.182 4.164Z"
|
|
stroke="#fff"
|
|
strokeWidth={1.33}
|
|
/>
|
|
<path
|
|
d="M11.569 10.578S4.828 9.19 4.034 8.99C3.241 8.793 2.25 7.754 2.25 6.414c0-1.34.991-2.38 1.784-2.578.794-.198 7.535-1.586 7.535-1.586M3.836 9.19v2.974c0 .876.71 1.586 1.586 1.586h.397c.876 0 1.586-.71 1.586-1.586V9.983"
|
|
stroke="#fff"
|
|
strokeWidth={1.33}
|
|
/>
|
|
</svg>
|
|
);
|
|
const hasViewBox = element.props.viewBox != null;
|
|
const isCustomIcon = element.props['data-custom-icon'] === 'true';
|
|
const defaultSize = isCustomIcon ? element.props.width : ICON_SIZE_MAP.xs;
|
|
const resolvedSize =
|
|
size != null ? (typeof size === 'number' ? size : ICON_SIZE_MAP[size]) : defaultSize;
|
|
const resolvedStrokeWidth =
|
|
strokeWidth != null
|
|
? strokeWidth
|
|
: typeof size === 'string' && size in STROKE_WIDTH_MAP
|
|
? STROKE_WIDTH_MAP[size]
|
|
: size == null
|
|
? STROKE_WIDTH_MAP.xs
|
|
: 2;
|
|
const w = element.props.width != null ? Number(element.props.width) : 24;
|
|
const h = element.props.height != null ? Number(element.props.height) : 24;
|
|
const viewBoxWhenMissing = `0 0 ${w} ${h}`;
|
|
const elementProps = {
|
|
...props,
|
|
className: className ? `signoz-icon ${className}` : 'signoz-icon',
|
|
...(!isCustomIcon && {
|
|
stroke: color,
|
|
strokeWidth: resolvedStrokeWidth,
|
|
}),
|
|
...(!isCustomIcon &&
|
|
!hasViewBox && {
|
|
viewBox: viewBoxWhenMissing,
|
|
}),
|
|
...(isCustomIcon && {
|
|
style: {
|
|
color,
|
|
...props.style,
|
|
},
|
|
viewBox: viewBoxWhenMissing,
|
|
}),
|
|
width: resolvedSize,
|
|
height: resolvedSize,
|
|
};
|
|
return cloneElement(element, elementProps);
|
|
};
|
|
SvgFeedbackMegaphone.displayName = 'SvgFeedbackMegaphone';
|
|
export default SvgFeedbackMegaphone;
|