Files
label-designer/src/components/TextDisplayAffixFields.tsx
2026-06-15 17:53:51 +08:00

52 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
);