main
Last change
on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[0c6b92a] | 1 | import styles from "../EntranceModal/EntranceModal.module.css";
|
---|
| 2 | import React from "react";
|
---|
| 3 |
|
---|
| 4 | export default function ModalSelectConnections({shape = null,availableShapes,updateModalData,addPinToList,}) {
|
---|
| 5 |
|
---|
| 6 | return shape && (
|
---|
| 7 | <div className={styles.formGroup}>
|
---|
| 8 | <label htmlFor="selectedPin">Select connections:</label>
|
---|
| 9 | <select
|
---|
| 10 | id="selectedPin"
|
---|
| 11 | name="selectedPin"
|
---|
| 12 | value={shape.info.selectedPin}
|
---|
| 13 | onChange={updateModalData}
|
---|
| 14 | required
|
---|
| 15 | >
|
---|
| 16 | <option value="">Select Connection</option>
|
---|
| 17 | {availableShapes.filter ((conn) =>
|
---|
| 18 | shape.info.selectedPins.includes(conn.name) === false &&
|
---|
| 19 | conn.name !== "" &&
|
---|
| 20 | conn.name !== shape.info.name
|
---|
| 21 | )
|
---|
| 22 | .map((conn, index) => (
|
---|
| 23 | <option key={index} value={conn.info.name}>
|
---|
| 24 | {conn.info.name}
|
---|
| 25 | </option>
|
---|
| 26 | ))}
|
---|
| 27 | </select>
|
---|
| 28 | <button type="button" onClick={addPinToList} className={styles.addButton}>
|
---|
| 29 | Add Connection
|
---|
| 30 | </button>
|
---|
| 31 | </div>
|
---|
| 32 | )
|
---|
| 33 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.