@@ -10,11 +10,14 @@ import {
1010 StyledModalEditableList ,
1111 StyledModalInput ,
1212 StyledModalInputRowContainer ,
13+ StyledModalInputSelector ,
14+ StyledModalInputSelectorTitle ,
1315 StyledModalRow ,
16+ StyledModalSelectIcon ,
1417 StyledModalTitlebar ,
1518} from "./Modal.styles" ;
1619import { useTheme } from "Utils" ;
17- import { ModelRowTypes } from "Types" ;
20+ import { ModalInputSelectIconEntry , ModelRowTypes } from "Types" ;
1821
1922const Modal = ( {
2023 id = "modal" ,
@@ -386,3 +389,56 @@ export const ModalInputDropArea = ({
386389 </ StyledModalDropArea >
387390 ) ;
388391} ;
392+
393+ interface ModalInputSelectIconProps {
394+ id : string ;
395+ title : string ;
396+ onChange : ( event : any ) => void ;
397+ selected : string ;
398+ entries : ModalInputSelectIconEntry [ ] ;
399+ }
400+
401+ export const ModalInputSelectIcon = ( {
402+ title,
403+ id,
404+ onChange,
405+ selected,
406+ entries,
407+ } : ModalInputSelectIconProps ) => {
408+ const theme = useTheme ( ) ;
409+
410+ return (
411+ < >
412+ < StyledModalInputSelectorTitle htmlFor = { id } >
413+ { title }
414+ </ StyledModalInputSelectorTitle >
415+ < StyledModalInputSelector >
416+ { entries . map ( ( entry ) => (
417+ < StyledModalSelectIcon
418+ hoverColor = { theme . palette . secondary }
419+ selectedColor = { theme . palette . primary }
420+ color = { theme . palette . text }
421+ roundness = { theme . roundness }
422+ icon = { entry . iconType }
423+ active = { selected === entry . id }
424+ >
425+ < label >
426+ < input
427+ type = "radio"
428+ name = { id }
429+ value = { entry . id }
430+ id = { entry . id }
431+ checked = { selected === entry . id }
432+ onChange = { onChange }
433+ />
434+ < div id = { "button-" + entry . id } >
435+ { entry . icon }
436+ < p > { entry . title } </ p >
437+ </ div >
438+ </ label >
439+ </ StyledModalSelectIcon >
440+ ) ) }
441+ </ StyledModalInputSelector >
442+ </ >
443+ ) ;
444+ } ;
0 commit comments