File size: 1,124 Bytes
48c7837
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { ReactNode } from "react"
import { FaCloudDownloadAlt } from "react-icons/fa"

import { cn } from "@/lib/utils"

export function DownloadVideo({
  video = "",
  disabled = false,
  onClick,
  children = <>Download</>
}: {
  video?: string
  disabled?: boolean
  onClick: () => void
  children?: ReactNode
}) {

  return (
    <>{
      (video && video.length > 128)
      ? <div
      className={cn(`
      w-full
      flex flex-row
      items-center justify-center
      transition-all duration-150 ease-in-out

    text-stone-800

      group
      pt-2 md:pt-4
      `, 
      disabled ? 'opacity-50' : 'cursor-pointer opacity-100 hover:scale-110 active:scale-150 hover:text-stone-950 active:text-black'
      )}
      style={{ textShadow: "rgb(255 255 255 / 19%) 0px 0px 2px" }}
      onClick={disabled ? undefined : onClick}
    >
      <div className="
      text-base md:text-lg lg:text-xl
      transition-all duration-150 ease-out
      group-hover:animate-swing
      "><FaCloudDownloadAlt /></div>
      <div className="text-xs md:text-sm lg:text-base">&nbsp;{children}</div>
    </div> : null}</>
  )
}