diff --git a/src/App.jsx b/src/App.jsx
index ff3285812..95cc66728 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -1,248 +1,111 @@
/* eslint-disable jsx-a11y/accessible-emoji */
-import React from 'react';
+import React, { useState } from 'react';
import './App.scss';
-// import usersFromServer from './api/users';
-// import categoriesFromServer from './api/categories';
-// import productsFromServer from './api/products';
-
-// const products = productsFromServer.map((product) => {
-// const category = null; // find by product.categoryId
-// const user = null; // find by category.ownerId
-
-// return null;
-// });
-
-export const App = () => (
-
-
-
Product Categories
-
-
-
-
-);
+ );
+};
diff --git a/src/components/FilterByInput/FilterByInput.jsx b/src/components/FilterByInput/FilterByInput.jsx
new file mode 100644
index 000000000..4e27622a0
--- /dev/null
+++ b/src/components/FilterByInput/FilterByInput.jsx
@@ -0,0 +1,33 @@
+export const FilterByInput = ({ filterBy, query, onClearButton }) => (
+
+
+ {
+ filterBy(event.target.value);
+ }}
+ />
+
+
+
+
+
+ {query
+ && (
+
+ {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
+
+
+ )}
+
+
+);
diff --git a/src/components/FilterUserList/FilterUserList.jsx b/src/components/FilterUserList/FilterUserList.jsx
new file mode 100644
index 000000000..28e34cd7d
--- /dev/null
+++ b/src/components/FilterUserList/FilterUserList.jsx
@@ -0,0 +1,16 @@
+import cn from 'classnames';
+
+export const FilterUserList = ({ owners, selectedUser, onSelectedUser }) => (
+ owners.map(user => (
+
onSelectedUser(user)}
+ >
+ {user}
+
+ ))
+);
diff --git a/src/components/Product/Product.jsx b/src/components/Product/Product.jsx
new file mode 100644
index 000000000..3ceb8d1f3
--- /dev/null
+++ b/src/components/Product/Product.jsx
@@ -0,0 +1,31 @@
+import cn from 'classnames';
+
+export const Product = ({ product }) => {
+ const {
+ id,
+ name,
+ category,
+ owner,
+ } = product;
+
+ return (
+
+
+ {id}
+ |
+
+ {name} |
+ {`${category.icon} - ${category.title}`} |
+
+
+ {owner.name}
+ |
+
+ );
+};
diff --git a/src/components/ProductList/ProductList.jsx b/src/components/ProductList/ProductList.jsx
new file mode 100644
index 000000000..b7b5134da
--- /dev/null
+++ b/src/components/ProductList/ProductList.jsx
@@ -0,0 +1,5 @@
+import { Product } from '../Product/Product';
+
+export const ProductList = ({ productList }) => (
+ productList.map(product =>
)
+);
diff --git a/src/components/Table/Table.jsx b/src/components/Table/Table.jsx
new file mode 100644
index 000000000..d5783f2cb
--- /dev/null
+++ b/src/components/Table/Table.jsx
@@ -0,0 +1,15 @@
+import { TableHead } from '../TableHead/TableHead';
+import { ProductList } from '../ProductList/ProductList';
+
+export const Table = ({ products }) => (
+
+);
diff --git a/src/components/TableHead/TableHead.jsx b/src/components/TableHead/TableHead.jsx
new file mode 100644
index 000000000..f57f55bd2
--- /dev/null
+++ b/src/components/TableHead/TableHead.jsx
@@ -0,0 +1,53 @@
+export const TableHead = () => (
+
+
+
+
+ ID
+
+
+
+
+
+
+
+ |
+
+
+
+ Product
+
+
+
+
+
+
+
+ |
+
+
+
+ Category
+
+
+
+
+
+
+
+ |
+
+
+
+ User
+
+
+
+
+
+
+
+ |
+
+
+);
diff --git a/src/utils.js b/src/utils.js
new file mode 100644
index 000000000..6c0ba201b
--- /dev/null
+++ b/src/utils.js
@@ -0,0 +1,55 @@
+import usersFromServer from './api/users';
+import categoriesFromServer from './api/categories';
+import productsFromServer from './api/products';
+
+export const products = productsFromServer.map((product) => {
+ const category1 = categoriesFromServer
+ .find(c => c.id === product.categoryId);
+ const user = usersFromServer.find(u => u.id === category1.ownerId);
+
+ return {
+ id: product.id,
+ name: product.name,
+ category: category1,
+ owner: user,
+ };
+});
+
+// get list of owners
+export function findOwners(productsList) {
+ const listOfOwners = [];
+
+ productsList.forEach((product) => {
+ const {
+ owner,
+ } = product;
+
+ if (!listOfOwners.includes(owner.name)) {
+ listOfOwners.push(owner.name);
+ }
+ });
+
+ return listOfOwners;
+}
+
+// filter by user function
+export function filterByOwner(productList, selectedUser) {
+ if (selectedUser === 'All') {
+ return productList;
+ }
+
+ return productList.filter((product) => {
+ const {
+ owner,
+ } = product;
+
+ return owner.name === selectedUser;
+ });
+}
+
+// filter by name function
+export function filterByName(productList, name) {
+ return productList
+ .filter(product => product.name.toLowerCase()
+ .includes(name.toLowerCase().trim()));
+}