File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import styled from 'styled-components'
3
+ import { mediumWeight } from '../../style/font'
4
+ import { xsmallRadius } from '../../style/border'
5
+
6
+ const SelectWrapper = styled . select `
7
+ width: 7rem;
8
+ padding: 3px 0 3px 3px;
9
+ font-weight: ${ mediumWeight } ;
10
+ color: black;
11
+ border-radius: ${ xsmallRadius } ;
12
+ `
13
+
14
+ function DropDown ( {
15
+ selectName,
16
+ selectId,
17
+ options,
18
+ labelText = undefined ,
19
+ } : {
20
+ selectName : string
21
+ selectId : string
22
+ options : { name : string ; value : string } [ ]
23
+ labelText ?: string | undefined
24
+ } ) {
25
+ return (
26
+ < >
27
+ { labelText && < label htmlFor = { selectId } > { labelText } </ label > }
28
+
29
+ < SelectWrapper name = { selectName } id = { selectId } >
30
+ { options . map ( ( option ) => {
31
+ return (
32
+ < option key = { option . value } value = { option . value } >
33
+ { option . value }
34
+ </ option >
35
+ )
36
+ } ) }
37
+ </ SelectWrapper >
38
+ </ >
39
+ )
40
+ }
41
+
42
+ export default DropDown
You can’t perform that action at this time.
0 commit comments