2020-07-08 19:36:36 +02:00
|
|
|
import React from "react";
|
|
|
|
import styled from "styled-components";
|
|
|
|
import { App, IAppProps } from "./app";
|
|
|
|
import { ItemList, Item, SubHeadline } from "./elements";
|
|
|
|
|
|
|
|
const CategoryHeadline = styled(SubHeadline)`
|
|
|
|
padding-top: 1rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const CategoryContainer = styled.div`
|
|
|
|
width: 100%;
|
|
|
|
`;
|
|
|
|
|
|
|
|
interface IAppCategoryProps {
|
|
|
|
name: string;
|
|
|
|
items: Array<IAppProps>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const AppCategory = ({ name, items }: IAppCategoryProps) => (
|
|
|
|
<CategoryContainer>
|
|
|
|
{name && <CategoryHeadline>{name}</CategoryHeadline>}
|
|
|
|
<ItemList>
|
|
|
|
{items.map((app, idx) => (
|
|
|
|
<Item key={[app.name, idx].join("")}>
|
|
|
|
<App
|
|
|
|
name={app.name}
|
|
|
|
icon={app.icon}
|
2020-07-10 00:17:18 +02:00
|
|
|
URL={app.URL}
|
2020-07-08 19:36:36 +02:00
|
|
|
displayURL={app.displayURL}
|
|
|
|
/>
|
|
|
|
</Item>
|
|
|
|
))}
|
|
|
|
</ItemList>
|
|
|
|
</CategoryContainer>
|
|
|
|
);
|