168 | {!isBuying ? (
169 | // Initial option selection buttons
170 |
188 | ) : (
189 | // Buy interface with different steps
190 |
191 | {buyingStep === 'allowance' ? (
192 | // Approval step
193 |
194 |
Approval Needed
195 |
You need to approve the transaction before proceeding.
196 |
197 |
211 |
219 |
220 |
221 | ) : buyingStep === 'confirm' ? (
222 | // Confirmation step
223 |
224 |
Confirm Transaction
225 |
226 | You are about to buy
227 | {amount} {selectedOption === 'A' ? market.optionA : market.optionB}
228 | share(s).
229 |
230 |
231 |
245 |
253 |
254 |
255 | ) : (
256 | // Amount input step
257 |
258 |
259 | {`1 ${selectedOption === 'A' ? market.optionA : market.optionB} = 1 PREDICT`}
260 |
261 |
262 |
263 |
264 | {
271 | const value = Math.max(0, Number(e.target.value));
272 | setAmount(value);
273 | setError(null);
274 | }}
275 | onKeyDown={(e) => {
276 | if (e.key === '-' || e.key === 'e') {
277 | e.preventDefault();
278 | }
279 | }}
280 | className={cn(
281 | "w-full",
282 | error && "border-red-500 focus-visible:ring-red-500"
283 | )}
284 | />
285 |
286 |
287 | {selectedOption === 'A' ? market.optionA : market.optionB}
288 |
289 |
290 |
291 | {error && (
292 |
293 | {error}
294 |
295 | )}
296 |
297 |
298 |
299 |
302 |
305 |
306 |
307 | )}
308 |