@coko/client
Version:
Client side common code for coko apps
52 lines (51 loc) • 1.5 kB
JavaScript
import { noop as e } from "../../toolkit/funcs.js";
import { grid as t } from "../../toolkit/themeHelper.js";
import "../../toolkit/index.js";
import n from "../common/Button.js";
import r from "../common/Form.js";
import i from "../common/VisuallyHiddenElement.js";
import "../common/index.js";
import "react";
import a from "styled-components";
import { jsx as o, jsxs as s } from "react/jsx-runtime";
//#region src/ui/authentication/ProfileForm.tsx
var c = a.div``, l = a.div`
display: flex;
gap: ${t(1)};
justify-content: right;
padding: 0 ${t(4)};
`, u = (t) => {
let { children: a, className: u, message: d = "", form: f, loading: p = !1, onSubmit: m, showSecondaryButton: h = !1, secondaryButtonAction: g = e, secondaryButtonLabel: _ = "Cancel", submitButtonLabel: v = "Save", submissionStatus: y, ...b } = t;
return /* @__PURE__ */ o(c, {
className: u,
children: /* @__PURE__ */ s(r, {
form: f,
layout: "vertical",
onFinish: m,
ribbonMessage: d,
ribbonPosition: "bottom",
submissionStatus: y,
...b,
children: [
a,
/* @__PURE__ */ s(l, { children: [h && /* @__PURE__ */ o(n, {
disabled: p,
onClick: g,
children: _
}), /* @__PURE__ */ o(n, {
"data-testid": "profile-form-submit-button",
htmlType: "submit",
loading: p,
type: "primary",
children: v
})] }),
p && /* @__PURE__ */ o(i, {
role: "status",
children: "Saving profile"
})
]
})
});
};
//#endregion
export { u as default };