diff --git a/apps/dashboard/src/components/dashboard-account-settings/editable-text.tsx b/apps/dashboard/src/components/dashboard-account-settings/editable-text.tsx new file mode 100644 index 000000000..7da646957 --- /dev/null +++ b/apps/dashboard/src/components/dashboard-account-settings/editable-text.tsx @@ -0,0 +1,58 @@ +'use client'; + +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { PencilSimple } from "@phosphor-icons/react"; +import { useState } from "react"; + +export function EditableText(props: { value: string, onSave?: (value: string) => void | Promise }) { + const [editing, setEditing] = useState(false); + const [editingValue, setEditingValue] = useState(props.value); + + return ( +
+ {editing ? ( + <> + setEditingValue(e.target.value)} + className="bg-white dark:bg-zinc-900 border-black/[0.08] dark:border-white/[0.08] rounded-xl px-3 py-2 shadow-sm focus-visible:ring-black/[0.06] dark:focus-visible:ring-white/[0.06] min-w-[200px]" + /> + + + + ) : ( + <> + {props.value} + + + )} +
+ ); +}