import { jsxs as p, jsx as i } from "react/jsx-runtime";
import c from "lodash/camelCase";
import x from "lodash/upperFirst";
import { Typography as e } from "@mui/material";
import { styled as d } from "../Theme/index.js";
function v({
  name: t,
  nameFormatter: a = (o) => typeof o == "string" ? o.split(" ").map((s) => x(c(s))).join(" ") : o,
  layout: n = "horizontal",
  children: r,
  valueComponent: l = "div",
  nameWidth: m = 90,
  ...f
}) {
  return /* @__PURE__ */ p(u, { layout: n, width: m, ...f, children: [
    /* @__PURE__ */ i(e, { color: "textSecondary", className: "info-row__name", children: a(t) }),
    r && /* @__PURE__ */ i(e, { color: "textPrimary", component: l, className: "info-row__value", children: r })
  ] });
}
const u = d("div")`
  display: flex;
  flex-direction: ${(t) => t.layout === "vertical" ? "column" : "row"};
  justify-content: flex-start;
  align-items: ${(t) => t.layout === "vertical" ? "flex-start" : "center"};
  margin-bottom: 16px;

  .info-row__name {
    width: ${(t) => t.width}px;
    margin-right: ${(t) => t.layout === "vertical" ? "0" : "8px"};
    margin-bottom: ${(t) => t.layout === "vertical" ? "8px" : "0"};
    text-transform: capitalize;
  }

  .info-row__value {
    flex: 1;
    overflow: auto;
    word-wrap: break-word;
    font-weight: 500;
  }

  @media (max-width: ${(t) => t.theme.breakpoints.values.md}px) {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    .info-row__name {
      font-weight: bold;
    }

    .info-row__value {
      width: 100%;
      font-size: 12px;
      margin-top: 8px;
    }
  }
`;
export {
  v as default
};
