sendou.ink/app/components/Image.tsx
Curt Grimes 984d14a55b Add ability to drag abilities into slots
- Do not allow dragging an ability onto a slot that cannot accept that
  ability.
- When dragging, dim slots that are not a valid target for the ability
  currently being dragged.
- Do not make any changes to the existing click behavior to assign
  abilities.
2022-10-01 00:19:31 -07:00

40 lines
668 B
TypeScript

export function Image({
path,
alt,
title,
className,
width,
height,
style,
}: {
path: string;
alt: string;
title?: string;
className?: string;
width?: number;
height?: number;
style?: React.CSSProperties;
}) {
return (
<picture title={title}>
<source
type="image/avif"
srcSet={`${path}.avif`}
className={className}
width={width}
height={height}
style={style}
/>
<img
alt={alt}
src={`${path}.png`}
className={className}
width={width}
height={height}
style={style}
draggable="false"
/>
</picture>
);
}