2021-03-05 22:00:32 +01:00
|
|
|
import React from "react";
|
|
|
|
import { AppCategory, IAppCategoryProps } from "./appCategory";
|
|
|
|
import { IAppProps } from "./app";
|
2020-07-08 19:36:36 +02:00
|
|
|
|
2021-03-05 22:00:32 +01:00
|
|
|
import { Headline, ListContainer } from "./elements";
|
2020-07-08 19:36:36 +02:00
|
|
|
|
2021-03-05 22:00:32 +01:00
|
|
|
export interface IAppListProps {
|
|
|
|
categories: Array<IAppCategoryProps>;
|
|
|
|
apps: Array<IAppProps>;
|
|
|
|
}
|
2020-07-10 00:17:18 +02:00
|
|
|
|
2021-03-05 22:00:32 +01:00
|
|
|
const AppList = ({ categories, apps }: IAppListProps) => {
|
2020-07-08 19:36:36 +02:00
|
|
|
return (
|
|
|
|
<ListContainer>
|
|
|
|
<Headline>Applications</Headline>
|
|
|
|
{categories &&
|
|
|
|
categories.map(({ name, items }, idx) => (
|
|
|
|
<AppCategory key={[name, idx].join("")} name={name} items={items} />
|
|
|
|
))}
|
|
|
|
{apps && (
|
|
|
|
<AppCategory
|
2020-09-08 13:18:58 +02:00
|
|
|
name={categories ? "Uncategorized apps" : ""}
|
2020-07-08 19:36:36 +02:00
|
|
|
items={apps}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</ListContainer>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AppList;
|