"use client";

import { useRef } from "react";
import Lottie, { LottieRefCurrentProps } from "lottie-react";
import animationData from "@/lottie/logo-loading.json";

type Props = {
  className?: string;
  autoplay?: boolean;
  loop?: boolean | number;
};
const LogoLottie = ({ className, autoplay = true, loop = false }: Props) => {
  const lottieRef = useRef<LottieRefCurrentProps>(null);
  return (
    <div className={className}>
      <Lottie
        lottieRef={lottieRef}
        animationData={animationData}
        autoplay={autoplay}
        loop={loop}
        style={{ width: "100%", height: "100%" }}
      />
    </div>
  );
};

export default LogoLottie;
