Files
kan/apps/web/src/components/LottieIcon.tsx
2024-12-13 08:32:21 +00:00

25 lines
530 B
TypeScript

import dynamic from "next/dynamic";
const Lottie = dynamic(() => import("react-lottie-player"), { ssr: false });
type IconProps = {
isPlaying: boolean;
index: number;
json: object;
};
const Icon: React.FC<IconProps> = ({ isPlaying, index, json }) => {
return (
<Lottie
key={index}
animationData={json}
play={isPlaying}
loop={false}
style={{ width: 20, height: 20, fill: "white" }}
rendererSettings={{ preserveAspectRatio: "xMidYMid slice" }}
/>
);
};
export default Icon;