fixed old noTag label showin in table view

This commit is contained in:
mushka 2022-08-26 20:14:34 +03:00
parent 5351719175
commit 84639f2575
2 changed files with 23 additions and 15 deletions

View File

@ -296,6 +296,7 @@ const FilesTableRow = (props) => {
id,
tagRef,
isRooms,
onSelectType,
} = props;
const { acceptBackground, background } = theme.dragAndDrop;

View File

@ -3,21 +3,28 @@ import React from "react";
import Tags from "@docspace/common/components/Tags";
import Tag from "@docspace/components/tag";
import { RoomsTypeTranslations } from "@docspace/common/constants";
const TagsCell = React.forwardRef(({ t, item, tagCount, onSelectTag }, ref) => {
return (
<div style={{ width: "100%", overflow: "hidden" }} ref={ref}>
{item.tags.length > 0 ? (
<Tags
tags={item.tags}
columnCount={tagCount}
onSelectTag={onSelectTag}
/>
) : (
<Tag label={t("NoTag")} onClick={onSelectTag} />
)}
</div>
);
});
const TagsCell = React.forwardRef(
({ t, item, tagCount, onSelectTag, onSelectType }, ref) => {
return (
<div style={{ width: "100%", overflow: "hidden" }} ref={ref}>
{item.tags.length > 0 ? (
<Tags
tags={item.tags}
columnCount={tagCount}
onSelectTag={onSelectTag}
/>
) : (
<Tag
isDefault
label={t(RoomsTypeTranslations[item.roomType])}
onClick={() => onSelectType(item.roomType)}
/>
)}
</div>
);
}
);
export default React.memo(TagsCell);