Web:Client:Add tag with providerType, change onSelectType to onSelectOption.

This commit is contained in:
Vlada Gazizova 2022-10-05 15:27:43 +03:00
parent 085306c74f
commit cf4559f486

View File

@ -5,9 +5,28 @@ import Tags from "@docspace/common/components/Tags";
import Tag from "@docspace/components/tag";
import { RoomsTypeTranslations } from "@docspace/common/constants";
const TagsCell = ({ t, item, tagCount, onSelectTag, onSelectType }) => {
const TagsCell = ({ t, item, tagCount, onSelectTag, onSelectOption }) => {
const styleTagsCell = {
width: "100%",
overflow: "hidden",
display: item.thirdPartyIcon ? "flex" : "",
};
return (
<div style={{ width: "100%", overflow: "hidden" }}>
<div style={styleTagsCell}>
{item.providerType && (
<Tag
icon={item.thirdPartyIcon}
label={item.providerKey}
onClick={() =>
onSelectOption({
option: "typeProvider",
value: item.providerType,
})
}
/>
)}
{item.tags.length > 0 ? (
<Tags
tags={item.tags}
@ -18,7 +37,12 @@ const TagsCell = ({ t, item, tagCount, onSelectTag, onSelectType }) => {
<Tag
isDefault
label={t(RoomsTypeTranslations[item.roomType])}
onClick={() => onSelectType(item.roomType)}
onClick={() =>
onSelectOption({
option: "defaultTypeRoom",
value: item.roomType,
})
}
/>
)}
</div>