@@ -4,74 +4,72 @@ import { FormattedMessage } from "react-intl";
44import useGetSiteSettings from "../../models/useGetSiteSettings" ;
55import { observer } from "mobx-react-lite" ;
66
7- export const ReportEncounterSpeciesSection = observer (
8- ( { store } ) => {
9- const { data } = useGetSiteSettings ( ) ;
10- let speciesList =
11- data ?. siteTaxonomies ?. map ( ( item ) => {
12- return {
13- value : item ?. scientificName ,
14- label : item ?. scientificName ,
15- } ;
16- } ) || [ ] ;
17- speciesList = [ ...speciesList , { value : "unknown" , label : "Unknown" } ] ;
7+ export const ReportEncounterSpeciesSection = observer ( ( { store } ) => {
8+ const { data } = useGetSiteSettings ( ) ;
9+ let speciesList =
10+ data ?. siteTaxonomies ?. map ( ( item ) => {
11+ return {
12+ value : item ?. scientificName ,
13+ label : item ?. scientificName + " (" + item ?. commonName + ")" ,
14+ } ;
15+ } ) || [ ] ;
16+ speciesList = [ ...speciesList , { value : "unknown" , label : "Unknown" } ] ;
1817
19- return (
20- < div >
21- < h5 >
18+ return (
19+ < div >
20+ < h5 >
21+ < FormattedMessage id = "SPECIES" />
22+ { store . speciesSection . required && < span > *</ span > }
23+ </ h5 >
24+ < p className = "fs-6" >
25+ < FormattedMessage id = "SPECIES_REQUIRED_IA_WARNING" />
26+ </ p >
27+
28+ < Form . Group >
29+ < Form . Label >
2230 < FormattedMessage id = "SPECIES" />
2331 { store . speciesSection . required && < span > *</ span > }
24- </ h5 >
25- < p className = "fs-6" >
26- < FormattedMessage id = "SPECIES_REQUIRED_IA_WARNING" />
27- </ p >
28-
29- < Form . Group >
30- < Form . Label >
31- < FormattedMessage id = "SPECIES" />
32- { store . speciesSection . required && < span > *</ span > }
33- </ Form . Label >
34- < div className = "position-relative d-inline-block w-100" >
35- < Form . Control
36- as = "select"
37- required = "true"
38- style = { { paddingRight : "30px" } }
39- value = { store . speciesSection . value }
40- onChange = { ( e ) => {
41- store . setSpeciesSectionValue ( e . target . value ) ;
42- } }
43- >
44- < option value = "" >
45- < FormattedMessage id = "SPECIES_INSTRUCTION" />
32+ </ Form . Label >
33+ < div className = "position-relative d-inline-block w-100" >
34+ < Form . Control
35+ as = "select"
36+ required = "true"
37+ style = { { paddingRight : "30px" } }
38+ value = { store . speciesSection . value }
39+ onChange = { ( e ) => {
40+ store . setSpeciesSectionValue ( e . target . value ) ;
41+ } }
42+ >
43+ < option value = "" >
44+ < FormattedMessage id = "SPECIES_INSTRUCTION" />
45+ </ option >
46+ { speciesList . map ( ( option , optionIndex ) => (
47+ < option key = { optionIndex } value = { option . value } >
48+ { option . label }
4649 </ option >
47- { speciesList . map ( ( option , optionIndex ) => (
48- < option key = { optionIndex } value = { option . value } >
49- { option . label }
50- </ option >
51- ) ) }
52- </ Form . Control >
50+ ) ) }
51+ </ Form . Control >
5352
53+ < i
54+ className = "bi bi-chevron-down position-absolute top-50 translate-middle-y text-secondary"
55+ style = { { right : "10px" , pointerEvents : "none" } }
56+ > </ i >
57+ </ div >
58+ { store . speciesSection . error && (
59+ < Alert
60+ variant = "danger"
61+ style = { {
62+ marginTop : "10px" ,
63+ } }
64+ >
5465 < i
55- className = "bi bi-chevron-down position-absolute top-50 translate-middle-y text-secondary "
56- style = { { right : "10px " , pointerEvents : "none " } }
66+ className = "bi bi-info-circle-fill "
67+ style = { { marginRight : "8px " , color : "#560f14 " } }
5768 > </ i >
58- </ div >
59- { store . speciesSection . error && (
60- < Alert
61- variant = "danger"
62- style = { {
63- marginTop : "10px" ,
64- } }
65- >
66- < i
67- className = "bi bi-info-circle-fill"
68- style = { { marginRight : "8px" , color : "#560f14" } }
69- > </ i >
70- < FormattedMessage id = "EMPTY_REQUIRED_WARNING" />
71- </ Alert >
72- ) }
73- </ Form . Group >
74- </ div >
75- ) ;
76- } ,
77- ) ;
69+ < FormattedMessage id = "EMPTY_REQUIRED_WARNING" />
70+ </ Alert >
71+ ) }
72+ </ Form . Group >
73+ </ div >
74+ ) ;
75+ } ) ;
0 commit comments