import React, { ComponentElement, ReactComponentElement, ReactElement, ReactNode } from 'react'; import { Wrapper, ToggleSwitch, Flex, WrapperProps } from 'dot-design-system'; import { IframeType } from 'dot-utils'; import Bolt from '../assets/bolt'; import CircleIcon from '../elements/CircleIcon'; import Code from '../assets/code'; interface Props { selectedFormat: IframeType[]; onFormatChange: (format: IframeType) => void; } const formatLabels: { [Item in IframeType]: string } = { [IframeType.Website]: 'Website', [IframeType.Amp]: 'AMP', }; const formatIcons: { [Item in IframeType]: (props: WrapperProps) => JSX.Element } = { [IframeType.Website]: (props) => , [IframeType.Amp]: (props) => , }; function PlacementSelectFormat({ selectedFormat, onFormatChange }: Props) { return ( {[IframeType.Website, IframeType.Amp].map((format) => { const Icon = formatIcons[format]; return ( {formatLabels[format]} onFormatChange(format)} /> ); })} ); } export default PlacementSelectFormat;