refactor: conditionally hide view button in tasks table when entity type is not document
This commit is contained in:
parent
67baf47dbd
commit
2ca2afd1c1
@ -199,19 +199,19 @@ const Tasks = (): ReactElement => {
|
|||||||
{
|
{
|
||||||
key: "actions",
|
key: "actions",
|
||||||
label: "",
|
label: "",
|
||||||
render: (task) => (
|
render: (task) => {
|
||||||
|
const isDocument = task.entity?.type?.toLowerCase() === "document";
|
||||||
|
if (!isDocument) return null;
|
||||||
|
return (
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => navigate(`/tenant/documents/${task.entity.id}`)}
|
||||||
if (task.entity.type.toLowerCase() === "document") {
|
|
||||||
navigate(`/tenant/documents/${task.entity.id}`);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className="font-semibold text-sm transition-colors hover:opacity-80"
|
className="font-semibold text-sm transition-colors hover:opacity-80"
|
||||||
style={{ color: primaryColor }}
|
style={{ color: primaryColor }}
|
||||||
>
|
>
|
||||||
View
|
View
|
||||||
</button>
|
</button>
|
||||||
),
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[navigate],
|
[navigate],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user