"use client";

import { formatDateTime } from "@/lib/constants";
import { Clock, ExternalLink, Timer } from "lucide-react";

interface InspectionMetaProps {
  url: string;
  createdAt: string;
  durationSeconds: number;
}

/** 검사 메타 정보 (URL, 일시, 소요시간) */
export function InspectionMeta({
  url,
  createdAt,
  durationSeconds,
}: InspectionMetaProps) {
  return (
    <div className="flex flex-wrap items-center gap-4 text-sm text-muted-foreground">
      <div className="flex items-center gap-1.5">
        <ExternalLink className="h-4 w-4" />
        <a
          href={url}
          target="_blank"
          rel="noopener noreferrer"
          className="hover:underline text-primary"
        >
          {url}
        </a>
      </div>
      <div className="flex items-center gap-1.5">
        <Clock className="h-4 w-4" />
        <span>검사 일시: {formatDateTime(createdAt)}</span>
      </div>
      <div className="flex items-center gap-1.5">
        <Timer className="h-4 w-4" />
        <span>소요 시간: {durationSeconds}초</span>
      </div>
    </div>
  );
}
