//=========================================== // THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template //=========================================== import { Button, Input, Typography } from "@hexclave/ui"; import { Edit } from "lucide-react"; import { useState } from "react"; import { useTranslation } from "../../lib/translations"; export function EditableText(props: { value: string, onSave?: (value: string) => void | Promise }) { const [editing, setEditing] = useState(false); const [editingValue, setEditingValue] = useState(props.value); const { t } = useTranslation(); return (
{editing ? ( <> setEditingValue(e.target.value)} /> ) : ( <> {props.value} )}
); }