"use client";
import { Link } from "@/i18n/navigation";
import { mediaUrl } from "@/app/lib/media";
import type { DatingProfile } from "../types";
interface SwipeCardProps {
profile: DatingProfile;
badgeText: string;
dragX: number;
isDragging: boolean;
isAnimatingOut: "left" | "right" | null;
onLike: () => void;
onDislike: () => void;
onSuperLike?: () => void;
showSuperLike?: boolean;
onBeginDrag: (clientX: number) => void;
onMoveDrag: (clientX: number) => void;
onEndDrag: () => void;
t: (key: string) => string;
}
export default function SwipeCard({
profile,
badgeText,
dragX,
isDragging,
isAnimatingOut,
onLike,
onDislike,
onSuperLike,
showSuperLike = false,
onBeginDrag,
onMoveDrag,
onEndDrag,
t,
}: SwipeCardProps) {
return (
{
if (e.key === "ArrowRight") onLike();
if (e.key === "ArrowLeft") onDislike();
}}
onPointerDown={(e) => {
e.currentTarget.setPointerCapture(e.pointerId);
onBeginDrag(e.clientX);
}}
onPointerMove={(e) => onMoveDrag(e.clientX)}
onPointerUp={onEndDrag}
onPointerCancel={onEndDrag}
>
45 ? "opacity-100" : "opacity-0"
}`}
>
{t("likeOverlay")}
{t("passOverlay")}
{badgeText}
e.stopPropagation()}
>
{t("report")}
e.stopPropagation()}>
{profile.name}๏ผ{profile.age}
๐ {profile.location}
{(profile.gender || profile.single) && (
{[profile.gender, profile.single].filter(Boolean).join(" ยท ")}
)}
{t("matchTags")}:
{profile.tags.map((tag) => (
{tag}
))}
{profile.bio}
e.stopPropagation()}
>
{t("dislike")}
{showSuperLike && onSuperLike ? (
{t("superlike")}
) : null}
{t("like")}
);
}