| 1 | "use client"; |
| 2 | |
| 3 | import { Edit3, Sparkles } from "lucide-react"; |
| 4 | |
| 5 | import { Button } from "@/components/ui/button"; |
| 6 | import { cn } from "@/lib/utils"; |
| 7 | |
| 8 | interface InfographicEmbedPlaceholderProps { |
| 9 | className?: string; |
| 10 | onEdit: () => void; |
| 11 | } |
| 12 | |
| 13 | export function InfographicEmbedPlaceholder({ |
| 14 | className, |
| 15 | onEdit, |
| 16 | }: InfographicEmbedPlaceholderProps) { |
| 17 | return ( |
| 18 | <div |
| 19 | className={cn( |
| 20 | "group relative size-full overflow-hidden rounded-lg border border-border/50 bg-linear-to-br from-muted/40 via-background to-muted/60", |
| 21 | className, |
| 22 | )} |
| 23 | > |
| 24 | {/* Subtle grid pattern */} |
| 25 | <div |
| 26 | className="absolute inset-0 opacity-[0.04]" |
| 27 | style={{ |
| 28 | backgroundImage: |
| 29 | "linear-gradient(to right, currentColor 1px, transparent 1px), linear-gradient(to bottom, currentColor 1px, transparent 1px)", |
| 30 | backgroundSize: "40px 40px", |
| 31 | }} |
| 32 | /> |
| 33 | |
| 34 | {/* Decorative corner accents */} |
| 35 | <div className="absolute top-0 left-0 size-16 rounded-tl-lg border border-primary/15" /> |
| 36 | <div className="absolute right-0 bottom-0 size-16 rounded-br-lg border border-primary/15" /> |
| 37 | |
| 38 | {/* Center cross lines for visual depth */} |
| 39 | <div className="absolute inset-0 flex items-center justify-center pointer-events-none"> |
| 40 | <div className="absolute h-full w-px bg-linear-to-b from-transparent via-border/30 to-transparent" /> |
| 41 | <div className="absolute h-px w-full bg-linear-to-r from-transparent via-border/30 to-transparent" /> |
| 42 | </div> |
| 43 | |
| 44 | <div className="relative z-10 flex h-full min-h-50 flex-col items-center justify-center gap-5 p-6 text-center"> |
| 45 | {/* Icon container */} |
| 46 | <div className="flex size-12 items-center justify-center rounded-xl bg-primary/10 ring-1 ring-primary/20 shadow-sm transition-transform duration-300 group-hover:scale-105"> |
| 47 | <Sparkles className="size-5 text-primary" /> |
| 48 | </div> |
| 49 | |
| 50 | <div className="space-y-1.5"> |
| 51 | <h3 className="text-base font-semibold text-foreground"> |
| 52 | Create an infographic |
| 53 | </h3> |
| 54 | <p className="max-w-xs text-sm text-muted-foreground"> |
| 55 | Generate a visual infographic and place it in this embed. |
| 56 | </p> |
| 57 | </div> |
| 58 | |
| 59 | <Button |
| 60 | type="button" |
| 61 | variant="outline" |
| 62 | onClick={onEdit} |
| 63 | className="gap-2 border-primary/30 text-primary hover:bg-primary/5 hover:border-primary/50 transition-colors" |
| 64 | data-infographic-edit="true" |
| 65 | > |
| 66 | <Edit3 className="size-4" /> |
| 67 | Edit infographic |
| 68 | </Button> |
| 69 | </div> |
| 70 | </div> |
| 71 | ); |
| 72 | } |
| 73 |