refactor: conditionally hide view button in tasks table when entity type is not document

This commit is contained in:
Yashwin 2026-06-25 18:37:41 +05:30
parent 67baf47dbd
commit 2ca2afd1c1

View File

@ -199,19 +199,19 @@ const Tasks = (): ReactElement => {
{ {
key: "actions", key: "actions",
label: "", label: "",
render: (task) => ( render: (task) => {
<button const isDocument = task.entity?.type?.toLowerCase() === "document";
onClick={() => { if (!isDocument) return null;
if (task.entity.type.toLowerCase() === "document") { return (
navigate(`/tenant/documents/${task.entity.id}`); <button
} onClick={() => 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],