feat: implement inline memo editor

This commit is contained in:
Steven
2024-07-17 21:07:36 +08:00
parent 956f21838d
commit e2fd79200e
4 changed files with 96 additions and 53 deletions

View File

@ -38,6 +38,7 @@ export interface Props {
autoFocus?: boolean;
memoPatchRef?: React.MutableRefObject<Partial<Memo>>;
onConfirm?: (memoName: string) => void;
onCancel?: () => void;
}
interface State {
@ -439,7 +440,12 @@ const MemoEditor = (props: Props) => {
))}
</Select>
</div>
<div className="shrink-0 flex flex-row justify-end items-center">
<div className="shrink-0 flex flex-row justify-end items-center gap-2">
{props.onCancel && (
<Button className="!font-normal" color="neutral" variant="plain" loading={state.isRequesting} onClick={props.onCancel}>
{t("common.cancel")}
</Button>
)}
<Button
className="!font-normal"
disabled={!allowSave}