import React, { Fragment } from 'react'; import styled from 'styled-components'; import { Field } from 'redux-form'; import { Row, Col } from 'joyent-react-styled-flexboxgrid'; import { Margin } from 'styled-components-spacing'; import pascalCase from 'pascal-case'; import titleCase from 'title-case'; import remcalc from 'remcalc'; import * as Assets from 'joyent-logo-assets'; import { H3, P, FormGroup, SectionList, SectionListItem, SectionListAnchor, H4, Select, Card } from 'joyent-ui-toolkit'; const Version = styled(Select)` min-width: 100%; width: ${remcalc(144)}; select { margin: 0; border-bottom-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; } `; export const Preview = ({ name, version, isVm }) => (

{name} - {version}

{isVm ? 'Hardware Virtual Machine' : 'Infrastructure Container'}

); const Image = ({ onClick, active, ...image }) => { const { imageName = '', versions = [] } = image; const id = `image-card-${imageName}`; const handleCardClick = ev => { return ev.target.id === id ? onClick(image) : null; }; const handleLogoClick = ev => { return onClick(image); }; const Logo = Assets[pascalCase(imageName)] || Assets.Placeholder; return (

{titleCase(imageName)}

{versions.map(({ name, version, id }) => ( ))}
); }; export const ImageType = ({ setImageType, vms }) => ( setImageType(true)}> Hardware virtual machine setImageType(false)}> Infrastructure container ); export default ({ images = [], onSelectLatest }) => (
{images.map(({ imageName, ...image }) => ( ))}
);