Skip to content

Commit

Permalink
chore: 공통 props 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
HiimKwak committed Nov 19, 2023
1 parent e0f43c4 commit 9e4694b
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/components/common/Icon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
import { ComponentProps } from 'react';

import { $ } from '@/utils/core';

import { IconName } from './icon.type';
import { iconMap } from './IconMap';

interface IconProps extends ComponentProps<'svg'> {
iconName: IconName;
width?: number;
height?: number;
className?: string;
}

export const Icon = ({
iconName,
width = 24,
height = 24,
className,
...props
}: IconProps) => {
export const Icon = ({ iconName, ...props }: IconProps) => {
const path = iconMap[iconName];
return (
<svg width={width} height={height} className={$(className)} {...props}>
<svg
fillRule="evenodd"
clipRule="evenodd"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path d={path} />
</svg>
);
Expand Down

0 comments on commit 9e4694b

Please sign in to comment.