This commit is contained in:
iqudoo
2026-06-13 06:13:25 +08:00
parent a08fbd1eb6
commit f71ee2f861
8 changed files with 543 additions and 103 deletions

View File

@@ -0,0 +1,51 @@
import React from 'react';
import { TemplateElement } from '../types';
import { CommitInput } from './CommitInput';
interface TextDisplayAffixFieldsProps {
elem: TemplateElement;
onChange: (elem: TemplateElement) => void;
}
const PropInput = CommitInput;
export const TextDisplayAffixFields: React.FC<TextDisplayAffixFieldsProps> = ({
elem,
onChange,
}) => (
<div className="grid grid-cols-2 gap-2 pt-2 border-t border-[#3a3a3a]">
<div>
<label className="ps-field-label"></label>
<PropInput
type="text"
value={elem.textDisplayPrefix ?? ''}
placeholder="如 ¥"
onCommit={(val) =>
onChange({
...elem,
textDisplayPrefix: val || undefined,
})
}
className="ps-field font-mono"
/>
</div>
<div>
<label className="ps-field-label"></label>
<PropInput
type="text"
value={elem.textDisplaySuffix ?? ''}
placeholder="如 元"
onCommit={(val) =>
onChange({
...elem,
textDisplaySuffix: val || undefined,
})
}
className="ps-field font-mono"
/>
</div>
<p className="col-span-2 text-[9px] text-[#666] leading-relaxed">
</p>
</div>
);