Angular job portal app
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

36 lignes
1.0 KiB

  1. import { IonItem, IonLabel, IonList, IonRadio, IonRadioGroup } from '@ionic/react';
  2. import { useState } from 'react';
  3. import styles from './Options.module.scss';
  4. interface OwnProps {
  5. options: string[];
  6. isSelected: (option: string) => void;
  7. }
  8. const Options: React.FC<OwnProps> = (props) => {
  9. const [selected, setSelected] = useState<string>("null");
  10. if (selected !== "null") props.isSelected(selected);
  11. const options = props.options.map((option, key) => {
  12. return (
  13. <IonItem lines='none' key={key} className={styles.options + " " + (option === selected) ? styles.highlighted : ""}>
  14. <IonLabel>{option}</IonLabel>
  15. <IonRadio mode='md' slot="start" value={option} />
  16. </IonItem>
  17. );
  18. });
  19. return (
  20. <div className={styles.optionHolder}>
  21. <IonList>
  22. <IonRadioGroup onIonChange={e => setSelected(e.detail.value)}>
  23. {options}
  24. </IonRadioGroup>
  25. </IonList>
  26. </div>
  27. );
  28. }
  29. export default Options;