import { jsx as i, jsxs as r } from "react/jsx-runtime";
import { memo as x } from "react";
import { FileWrapper as n, FileHeader as p, FileUploadSuccessIcon as v, FileSizeLabel as h, FileUploadProgress as z } from "./FilePrimitive.js";
import g from "../types/FileStatus.js";
import f from "../../icon/Icon.js";
import { c as y } from "../../../index-BtlgVD4m.js";
import o from "../../button/Button.js";
const F = ({ file: a, onDownload: c, onRemove: e }) => {
  const { name: l, url: u, size: m, status: s, error: t, progress: d } = a;
  return s === g.Error ? /* @__PURE__ */ i(n, { status: s, children: /* @__PURE__ */ r("div", { className: "flex-1", children: [
    /* @__PURE__ */ r("div", { className: "flex items-center gap-[var(--spacing-4)]", children: [
      /* @__PURE__ */ i(f, { name: "CircleAlert", size: 16 }),
      /* @__PURE__ */ r(p, { children: [
        l,
        " ",
        t && t.code
      ] }),
      /* @__PURE__ */ i(f, { name: "X", size: 16, onClick: () => e == null ? void 0 : e(a) })
    ] }),
    /* @__PURE__ */ i(
      "div",
      {
        className: y(
          "pl-[var(--spacing-8)]",
          "text-[length:var(--typography-base-sizes-small-font-size)]",
          "font-[var(--font-weight-normal)]",
          "leading-[var(--typography-base-sizes-small-line-height)]"
        ),
        children: t && t.message
      }
    )
  ] }) }) : s === g.Success ? /* @__PURE__ */ i(n, { status: s, children: /* @__PURE__ */ r("div", { className: "flex items-center justify-start gap-[var(--spacing-4)]", children: [
    /* @__PURE__ */ i(v, {}),
    /* @__PURE__ */ r("div", { className: "flex-1", children: [
      /* @__PURE__ */ i(p, { children: l }),
      /* @__PURE__ */ i(h, { size: m })
    ] }),
    /* @__PURE__ */ r("div", { className: "flex items-center gap-[var(--spacing-2)]", children: [
      u && /* @__PURE__ */ i(o, { type: "button", variant: "ghost", size: "iconSm", icon: "Download", onClick: () => c == null ? void 0 : c(a) }),
      /* @__PURE__ */ i(o, { type: "button", variant: "ghost", size: "iconSm", icon: "Trash", onClick: () => e == null ? void 0 : e(a) })
    ] })
  ] }) }) : /* @__PURE__ */ r(n, { status: s, children: [
    /* @__PURE__ */ i("div", { className: "flex items-center justify-start gap-[var(--spacing-4)]", children: /* @__PURE__ */ r("div", { className: "flex-1", children: [
      /* @__PURE__ */ i(p, { children: l }),
      /* @__PURE__ */ i(h, { size: m })
    ] }) }),
    s === "uploading" && d && /* @__PURE__ */ i(z, { progress: d })
  ] });
}, U = x(F);
export {
  U as default
};
//# sourceMappingURL=File.js.map
