mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-02-20 07:37:26 -05:00
14 lines
415 B
TypeScript
14 lines
415 B
TypeScript
import { getIcon, iconNames } from '@sd/assets/util';
|
|
import { HTMLAttributes } from 'react';
|
|
import { useIsDark } from '~/hooks';
|
|
|
|
interface Props extends HTMLAttributes<HTMLImageElement> {
|
|
name: keyof typeof iconNames;
|
|
size?: number;
|
|
}
|
|
|
|
export const Icon = ({ name, size, ...props }: Props) => {
|
|
const isDark = useIsDark();
|
|
return <img src={getIcon(name, isDark)} width={size} height={size} {...props} />;
|
|
};
|