import React from 'react'; import { Wrapper, Grid } from 'dot-design-system'; import { IWidget } from 'dot-utils'; import { path } from 'ramda'; import CircleIconButton from '../elements/CircleIconButton'; interface Props { widgets: IWidget[]; onSelect: (widget: IWidget) => void; } function PlacementWidgetSelect({ widgets, onSelect }: Props) { const handleCreateWidgetClick = (e: any) => { e.preventDefault(); const anchor = e.target.closest('a'); if (anchor) { window.open(anchor.href); } }; return ( Click here to Create Account/Login {widgets.map((widget) => { const imgSrc = path(['questions', 0, 'imgSrc'], widget); return ( onSelect(widget)}> {widget.title || `${widget.type} Widget - ID: ${widget.id}`} ); })} ); } export default PlacementWidgetSelect;