All files / Rindu/components/icons Heart.tsx

83.33% Statements 5/6
0% Branches 0/1
100% Functions 3/3
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26        19x   19x   2x       12x                 12x        
import { CSSProperties, HTMLAttributes, ReactElement } from "react";
 
import { LottieOptions } from "lottie-react";
 
import dynamic from "next/dynamic";
 
import { isServer } from "utils";
 
const HeartAnimated = dynamic(() => import("./animated/Heart"), {
  ssr: false,
});
 
export default function Heart(
  props: {
    active: boolean | string;
    handleLike?: () => Promise<true | null>;
    handleDislike?: () => Promise<true | null>;
    options?: LottieOptions;
    style?: CSSProperties;
  } & HTMLAttributes<HTMLButtonElement>
): ReactElement | null {
  Iif (isServer()) return null;
 
  return <HeartAnimated {...props} />;
}