"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Input } from "@open-mercato/ui/primitives/input";
import { useT } from "@open-mercato/shared/lib/i18n/context";
const AddressFields = (props) => {
  const { prefix, address, onChange, disabled } = props;
  const t = useT();
  return /* @__PURE__ */ jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [
    /* @__PURE__ */ jsxs("div", { className: "sm:col-span-2", children: [
      /* @__PURE__ */ jsx("label", { htmlFor: `${prefix}-line1`, className: "mb-1 block text-xs font-medium text-muted-foreground", children: t("shipping_carriers.create.field.addressLine1", "Address line 1") }),
      /* @__PURE__ */ jsx(
        Input,
        {
          id: `${prefix}-line1`,
          value: address.line1,
          onChange: (event) => onChange({ ...address, line1: event.target.value }),
          disabled
        }
      )
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "sm:col-span-2", children: [
      /* @__PURE__ */ jsx("label", { htmlFor: `${prefix}-line2`, className: "mb-1 block text-xs font-medium text-muted-foreground", children: t("shipping_carriers.create.field.addressLine2", "Address line 2") }),
      /* @__PURE__ */ jsx(
        Input,
        {
          id: `${prefix}-line2`,
          value: address.line2 ?? "",
          onChange: (event) => onChange({ ...address, line2: event.target.value || void 0 }),
          disabled
        }
      )
    ] }),
    /* @__PURE__ */ jsxs("div", { children: [
      /* @__PURE__ */ jsx("label", { htmlFor: `${prefix}-city`, className: "mb-1 block text-xs font-medium text-muted-foreground", children: t("shipping_carriers.create.field.city", "City") }),
      /* @__PURE__ */ jsx(
        Input,
        {
          id: `${prefix}-city`,
          value: address.city,
          onChange: (event) => onChange({ ...address, city: event.target.value }),
          disabled
        }
      )
    ] }),
    /* @__PURE__ */ jsxs("div", { children: [
      /* @__PURE__ */ jsx("label", { htmlFor: `${prefix}-postal`, className: "mb-1 block text-xs font-medium text-muted-foreground", children: t("shipping_carriers.create.field.postalCode", "Postal code") }),
      /* @__PURE__ */ jsx(
        Input,
        {
          id: `${prefix}-postal`,
          value: address.postalCode,
          onChange: (event) => onChange({ ...address, postalCode: event.target.value }),
          disabled
        }
      )
    ] }),
    /* @__PURE__ */ jsxs("div", { children: [
      /* @__PURE__ */ jsx("label", { htmlFor: `${prefix}-country`, className: "mb-1 block text-xs font-medium text-muted-foreground", children: t("shipping_carriers.create.field.countryCode", "Country code (ISO)") }),
      /* @__PURE__ */ jsx(
        Input,
        {
          id: `${prefix}-country`,
          value: address.countryCode,
          placeholder: "PL",
          maxLength: 3,
          onChange: (event) => onChange({ ...address, countryCode: event.target.value.toUpperCase() }),
          disabled
        }
      )
    ] })
  ] });
};
export {
  AddressFields
};
//# sourceMappingURL=AddressFields.js.map
