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",
label: "",
render: (task) => (
render: (task) => {
const isDocument = task.entity?.type?.toLowerCase() === "document";
if (!isDocument) return null;
return (
<button
onClick={() => {
if (task.entity.type.toLowerCase() === "document") {
navigate(`/tenant/documents/${task.entity.id}`);
}
}}
onClick={() => navigate(`/tenant/documents/${task.entity.id}`)}
className="font-semibold text-sm transition-colors hover:opacity-80"
style={{ color: primaryColor }}
>
View
</button>
),
);
},
},
],
[navigate],