fix(filters): hide tooltip when actions are active (#1318)

This commit is contained in:
soup 2023-12-25 19:50:58 +01:00 committed by GitHub
parent 4884fec89c
commit 0ab404f81a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -639,28 +639,39 @@ function FilterListItem({ filter, values, idx }: FilterListItemProps) {
) : filter.priority} ) : filter.priority}
</span> </span>
<span className="z-10 whitespace-nowrap text-xs font-medium text-gray-600 dark:text-gray-400"> <span className="z-10 whitespace-nowrap text-xs font-medium text-gray-600 dark:text-gray-400">
<Tooltip {filter.actions_count === 0 || filter.actions_enabled_count === 0 ? (
label={ <Tooltip
<Link label={
to={`${filter.id.toString()}/actions`} <Link
className="flex items-center cursor-pointer hover:text-black dark:hover:text-gray-300" to={`${filter.id.toString()}/actions`}
> className="flex items-center cursor-pointer hover:text-black dark:hover:text-gray-300"
<span className={filter.actions_count === 0 || filter.actions_enabled_count === 0 ? "text-red-500 hover:text-red-400 dark:hover:text-red-400" : ""}> >
Actions: {filter.actions_enabled_count}/{filter.actions_count} <span className={filter.actions_count === 0 || filter.actions_enabled_count === 0 ? "text-red-500 hover:text-red-400 dark:hover:text-red-400" : ""}>
</span> Actions: {filter.actions_enabled_count}/{filter.actions_count}
</Link> </span>
} </Link>
> }
{filter.actions_count === 0 ? ( >
<> {filter.actions_count === 0 ? (
{"No actions defined. Set up actions to enable snatching."} <>
</> {"No actions defined. Set up actions to enable snatching."}
) : filter.actions_enabled_count === 0 ? ( </>
<> ) : filter.actions_enabled_count === 0 ? (
{"You need to enable at least one action in the filter otherwise you will not get any snatches."} <>
</> {"You need to enable at least one action in the filter otherwise you will not get any snatches."}
) : null} </>
</Tooltip> ) : null}
</Tooltip>
) : (
<Link
to={`${filter.id.toString()}/actions`}
className="flex items-center cursor-pointer hover:text-black dark:hover:text-gray-300"
>
<span>
Actions: {filter.actions_enabled_count}/{filter.actions_count}
</span>
</Link>
)}
</span> </span>
</div> </div>
</div> </div>