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",
|
||||
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],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user