fixed old noTag label showin in table view
This commit is contained in:
parent
5351719175
commit
84639f2575
@ -296,6 +296,7 @@ const FilesTableRow = (props) => {
|
||||
id,
|
||||
tagRef,
|
||||
isRooms,
|
||||
onSelectType,
|
||||
} = props;
|
||||
const { acceptBackground, background } = theme.dragAndDrop;
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user