import { useTheme } from 'next-themes' import Image from 'next/image' import { useMemo } from 'react' import type { SkillName } from './skills' import { skills } from './skills' export interface SkillComponentProps { skill: SkillName } export const SkillComponent: React.FC = (props) => { const { skill } = props const skillProperties = skills[skill] const { theme } = useTheme() const image = useMemo(() => { if (typeof skillProperties.image === 'string') { return skillProperties.image } if (theme === 'light') { return skillProperties.image.light } return skillProperties.image.dark }, [skillProperties, theme]) return (
{skill}

{skill}

) }