Untitled

mail@pastecode.io avatar
unknown
plain_text
25 days ago
2.7 kB
2
Indexable
Never
   <Modal container={{ className: `modalContent` }}>
                            <div className="row">
                                <h1 className="column weightSmaller">Add New Rate</h1>
                                <button type="button" className="rack weightNone column alignCenter justifyCenter" onClick={() => setIsModalOpen(false)}>
                                    <Icon.XMark fill="Background" />
                                </button>
                            </div>
                            <div className="verticalScrollContainer stack weightSmaller card">
                                <div className="inputContainer">
                                    <SearchInput
                                        id="typeInput"
                                        label="Type of Rate"
                                        name="type"
                                        state={[newRate, setNewRate]}
                                        required
                                        options={Object.keys(Rate.RateMap)
                                            .filter((registeredRate) => !rates.some((rate) => rate.type === registeredRate))
                                            .map((rate) => ({
                                                display: Rate.RateMap[rate],
                                                value: rate
                                            }))}
                                    />
                                </div>
                                <div className="inputContainer">
                                    <Input
                                        id="amountInput"
                                        label="Amount"
                                        type="text"
                                        name="amount"
                                        state={[newRate, setNewRate]}
                                        transform={Toolbox.Validation.doubleTransform}
                                        required
                                    />
                                </div>
                                {/*<Extensible moduleName={properties.meta.name} extensionKey="rateMetaUpdate" rate={newRate} />*/}
                            </div>
                            <button
                                type="button"
                                className="rack alignCenter justifyCenter"
                                disabled={newRate.type === "" || !newRate.amount}
                                onClick={addRate}>
                                Add
                            </button>
                        </Modal>
Leave a Comment