|
|
@ -1,4 +1,3 @@
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import { kinds } from 'Helpers/Props';
|
|
|
|
import { kinds } from 'Helpers/Props';
|
|
|
@ -6,16 +5,15 @@ import Label from './Label';
|
|
|
|
import styles from './TagList.css';
|
|
|
|
import styles from './TagList.css';
|
|
|
|
|
|
|
|
|
|
|
|
function TagList({ tags, tagList }) {
|
|
|
|
function TagList({ tags, tagList }) {
|
|
|
|
|
|
|
|
const sortedTags = tags
|
|
|
|
|
|
|
|
.map((tagId) => tagList.find((tag) => tag.id === tagId))
|
|
|
|
|
|
|
|
.filter((tag) => !!tag)
|
|
|
|
|
|
|
|
.sort((a, b) => a.label.localeCompare(b.label));
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={styles.tags}>
|
|
|
|
<div className={styles.tags}>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tags.map((t) => {
|
|
|
|
sortedTags.map((tag) => {
|
|
|
|
const tag = _.find(tagList, { id: t });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!tag) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Label
|
|
|
|
<Label
|
|
|
|
key={tag.id}
|
|
|
|
key={tag.id}
|
|
|
|