You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
48 lines
1.4 KiB
import React, { Component } from 'react'; |
|
import { Breadcrumb, Container, Dropdown, Header, Icon, Item, Label, Menu, Segment, Input } from 'semantic-ui-react' |
|
import { Link } from 'react-router-dom'; |
|
|
|
class Category extends Component { |
|
render() { |
|
const data = this.props.data; |
|
const user = this.props.user; |
|
const match = this.props.match; |
|
|
|
const category = data.categories.find(x => |
|
x.slug === match.params.category |
|
); |
|
|
|
return ( |
|
<Container> |
|
<Breadcrumb size='large'> |
|
<Breadcrumb.Section link as={Link} to='/'>Categories</Breadcrumb.Section> |
|
<Breadcrumb.Divider icon='right angle' /> |
|
<Breadcrumb.Section active>{category.name}</Breadcrumb.Section> |
|
</Breadcrumb> |
|
|
|
<Item.Group link unstackable divided> |
|
{category.tools.map((x, n) => |
|
<Item as={Link} to={'/' + category.slug + '/' + x.slug} key={n}> |
|
<Item.Image size='tiny' src={x.photo} /> |
|
<Item.Content> |
|
<Item.Header>{x.name}</Item.Header> |
|
<Item.Description> |
|
{user.profile.authorized_tools.includes(x.slug) ? |
|
<Label color='green'> |
|
<Icon name='check' /> Authorized |
|
</Label> : <Label color='red'> |
|
<Icon name='x' /> Unauthorized |
|
</Label> |
|
} |
|
</Item.Description> |
|
<Item.Extra>Wiki ID: {x.wikiId}</Item.Extra> |
|
</Item.Content> |
|
</Item> |
|
)} |
|
</Item.Group> |
|
</Container> |
|
); |
|
} |
|
} |
|
|
|
export default Category;
|
|
|