import React, { Fragment } from 'react';
import { Field } from 'redux-form';
import styled from 'styled-components';
import { Margin } from 'styled-components-spacing';
import remcalc from 'remcalc';
import Flex from 'styled-flex-component';
import bytes from 'bytes';
import {
H3,
H4,
Sup,
FormGroup,
Button,
TableTh,
TableTr,
TableThead,
TableTbody,
Table,
TableTd,
Radio,
Checkbox,
FormLabel,
GeneralIcon,
StorageIcon,
CpuIcon,
MemoryIcon
} from 'joyent-ui-toolkit';
import Empty from '@components/empty';
const GroupIcons = {
MEMORY: ,
STORAGE: ,
GENERAL: ,
COMPUTE:
};
const VerticalDivider = styled.div`
width: ${remcalc(1)};
background: ${props => props.theme.grey};
height: ${remcalc(18)};
display: flex;
align-self: flex-end;
margin: 0 ${remcalc(18)};
box-sizing: border-box;
`;
const TableTrActionable = styled(TableTr)`
cursor: pointer;
`;
export const Filters = ({ onResetFilters }) => (
Filters
{GroupIcons.COMPUTE}
Compute Optimized
{GroupIcons.MEMORY}
Memory Optimized
{GroupIcons.GENERAL}
General Purpose
{GroupIcons.STORAGE}
Storage Optimized
SSD
);
export const Package = ({
selected = false,
id,
name,
group,
memory,
price,
vcpus,
disk,
ssd,
hasVms,
sortBy,
onRowClick
}) => (
onRowClick(id)}>
{GroupIcons[group]}
{name}
{bytes(memory, { decimalPlaces: 0, unitSeparator: ' ' })}
{bytes(disk, { decimalPlaces: 0, unitSeparator: ' ' })}
{ssd && SSD}
{hasVms && (
{vcpus}
)}
{price}
);
export const Packages = ({
pristine,
sortBy = 'name',
sortOrder = 'desc',
onSortBy = () => null,
hasVms,
children,
packages
}) => (
);
export const Overview = ({
name,
price,
memory,
vcpus,
hasVms,
ssd,
disk,
onCancel
}) => (
{name}
{price} $
{bytes(memory, { decimalPlaces: 0, unitSeparator: ' ' })}
{hasVms && (
{vcpus} vCPUS
)}
{bytes(disk, { decimalPlaces: 0, unitSeparator: ' ' })} disk
{ssd && SSD}
);