12 lines
326 B
TypeScript
12 lines
326 B
TypeScript
|
import * as HeroIcon from '@heroicons/react/24/outline'
|
||
|
import { ComponentProps } from 'react'
|
||
|
|
||
|
type Props = {
|
||
|
name: keyof typeof HeroIcon
|
||
|
} & ComponentProps<typeof HeroIcon.AcademicCapIcon>
|
||
|
|
||
|
export const Icon = ({ name, ...props }: Props) => {
|
||
|
const IconComponent = HeroIcon[name]
|
||
|
return <IconComponent {...props} />
|
||
|
}
|