mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 04:00:09 +00:00
Initial commit of eigent-main
This commit is contained in:
commit
723df5a03e
1144 changed files with 103478 additions and 0 deletions
50
package/@stackframe/react/dist/esm/components-page/account-settings/editable-text.js
vendored
Normal file
50
package/@stackframe/react/dist/esm/components-page/account-settings/editable-text.js
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
// src/components-page/account-settings/editable-text.tsx
|
||||
import { Button, Input, Typography } from "@stackframe/stack-ui";
|
||||
import { Edit } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "../../lib/translations";
|
||||
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
||||
function EditableText(props) {
|
||||
const [editing, setEditing] = useState(false);
|
||||
const [editingValue, setEditingValue] = useState(props.value);
|
||||
const { t } = useTranslation();
|
||||
return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: editing ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
||||
/* @__PURE__ */ jsx(
|
||||
Input,
|
||||
{
|
||||
value: editingValue,
|
||||
onChange: (e) => setEditingValue(e.target.value)
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ jsx(
|
||||
Button,
|
||||
{
|
||||
size: "sm",
|
||||
onClick: async () => {
|
||||
await props.onSave?.(editingValue);
|
||||
setEditing(false);
|
||||
},
|
||||
children: t("Save")
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ jsx(
|
||||
Button,
|
||||
{
|
||||
size: "sm",
|
||||
variant: "secondary",
|
||||
onClick: () => {
|
||||
setEditingValue(props.value);
|
||||
setEditing(false);
|
||||
},
|
||||
children: t("Cancel")
|
||||
}
|
||||
)
|
||||
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
||||
/* @__PURE__ */ jsx(Typography, { children: props.value }),
|
||||
/* @__PURE__ */ jsx(Button, { onClick: () => setEditing(true), size: "icon", variant: "ghost", children: /* @__PURE__ */ jsx(Edit, { className: "w-4 h-4" }) })
|
||||
] }) });
|
||||
}
|
||||
export {
|
||||
EditableText
|
||||
};
|
||||
//# sourceMappingURL=editable-text.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue