2025-04-28 00:47:36 +00:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import React from 'react'
|
2025-04-28 14:42:01 +00:00
|
|
|
import Image from 'next/image'
|
2025-04-28 00:47:36 +00:00
|
|
|
import Link from 'next/link'
|
|
|
|
|
import {
|
|
|
|
|
HoverCard,
|
|
|
|
|
HoverCardContent,
|
|
|
|
|
HoverCardTrigger,
|
|
|
|
|
} from "@/components/ui/hover-card"
|
|
|
|
|
|
|
|
|
|
export interface HoverCardsProps {
|
|
|
|
|
triggerText: string
|
|
|
|
|
videourl: string
|
|
|
|
|
description: string
|
|
|
|
|
linkText?: string
|
2025-04-28 14:42:01 +00:00
|
|
|
link?: string,
|
|
|
|
|
isImage?: boolean,
|
2025-04-28 00:47:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function HoverCards({
|
|
|
|
|
triggerText,
|
|
|
|
|
videourl,
|
|
|
|
|
description,
|
|
|
|
|
link = '#',
|
2025-04-28 14:42:01 +00:00
|
|
|
linkText = 'Purchase & Read More',
|
|
|
|
|
isImage
|
2025-04-28 00:47:36 +00:00
|
|
|
}: HoverCardsProps) {
|
|
|
|
|
return (
|
|
|
|
|
<HoverCard>
|
|
|
|
|
<HoverCardTrigger asChild>
|
2025-04-29 13:12:00 +00:00
|
|
|
<span className="text-blue-400 cursor-pointer underline inline">{triggerText}</span>
|
2025-04-28 00:47:36 +00:00
|
|
|
</HoverCardTrigger>
|
|
|
|
|
<HoverCardContent className="w-80">
|
|
|
|
|
<div className="max-w-xs bg-white rounded-lg overflow-hidden shadow-lg">
|
|
|
|
|
<div className="relative h-48 w-full">
|
2025-04-28 14:42:01 +00:00
|
|
|
{isImage ?
|
|
|
|
|
<Image src={videourl} alt={videourl} width={100} height={100} className="absolute top-0 left-0 w-full h-full object-cover" />
|
|
|
|
|
:
|
2025-04-28 00:47:36 +00:00
|
|
|
<video
|
|
|
|
|
className="absolute top-0 left-0 w-full h-full object-cover"
|
|
|
|
|
muted
|
|
|
|
|
loop
|
|
|
|
|
playsInline
|
|
|
|
|
autoPlay
|
|
|
|
|
src={videourl}
|
|
|
|
|
></video>
|
2025-04-28 14:42:01 +00:00
|
|
|
}
|
|
|
|
|
|
2025-04-28 00:47:36 +00:00
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="p-4">
|
|
|
|
|
<p className="text-gray-700 text-sm mb-4">
|
|
|
|
|
{description}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<Link href={link}>
|
|
|
|
|
<span className="text-purple-700 font-medium text-sm hover:text-purple-900 transition-colors">
|
|
|
|
|
{linkText}
|
|
|
|
|
</span>
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</HoverCardContent>
|
|
|
|
|
</HoverCard>
|
|
|
|
|
)
|
2025-04-29 13:12:00 +00:00
|
|
|
}
|