import type { ReactNode } from "react";
import { cn } from "@/pages/app/components/ui";

/** A neutral details card used by the review / result screens. */
export function StatusCard({ children }: { children: ReactNode }) {
  return (
    <div className="w-full rounded-[18px] bg-background-100 border border-background-200 p-4">
      <div className="space-y-3.5">{children}</div>
    </div>
  );
}

export function StatusDivider() {
  return <div className="h-px bg-background-200" />;
}

export function StatusRow({
  label,
  value,
  badge,
  dir,
  strong,
}: {
  label: string;
  value?: string;
  badge?: ReactNode;
  dir?: "rtl" | "ltr";
  strong?: boolean;
}) {
  return (
    <div className="flex items-center justify-between gap-3">
      <span className="text-[12.5px] text-foreground-600 shrink-0">{label}</span>
      {badge ?? (
        <span
          className={cn(
            "text-[13px] font-semibold text-foreground-950 text-left",
            strong && "font-bold",
          )}
          dir={dir}
        >
          {value}
        </span>
      )}
    </div>
  );
}