update edit provider

- add field currency
This commit is contained in:
Wikzyy
2025-04-09 15:16:36 +07:00
parent e9b25006b0
commit b8c2d0ff3c

View File

@ -53,11 +53,13 @@ const EditDialog = () => {
name: string;
description: string;
status: string;
currency_id: string;
group: string[];
} = {
name: '',
description: '',
status: '',
currency_id: '',
group: []
};
const [formField, setFormField] = useState(initialState);
@ -164,6 +166,8 @@ const EditDialog = () => {
}
};
const selectedCurrency = currencies.find((currency) => currency.ID === formField.currency_id);
const selectedGroupNames = groups
.filter((g) => formField.group.includes(g.id))
.map((g) => g.name)
@ -257,6 +261,21 @@ const EditDialog = () => {
</div>
</div>
<div className="w-full">
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label className="form-label flex items-center gap-1 max-w-56">Currency</label>
<div className="relative w-full">
<Input
type="text"
placeholder="Empty"
value={selectedCurrency?.name}
readOnly
className="bg-gray-100 border border-dashed border-gray-400 text-gray-600 cursor-not-allowed"
/>
</div>
</div>
</div>
<div className="w-full">
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label className="form-label flex items-center gap-1 max-w-56">Groups</label>