refactor: replace remaining MUI tooltips (#20938)

closes #19974 

This PR replaces all remaining MUI tooltips with our shadcn tooltip
component, and uncomments the linter restriction on importing the MUI
tooltip
This commit is contained in:
Andrew Aquino
2025-12-15 08:12:27 -08:00
committed by GitHub
parent b073357414
commit 13fbbcd279
11 changed files with 210 additions and 144 deletions
@@ -1,6 +1,10 @@
import Tooltip from "@mui/material/Tooltip";
import type { Workspace } from "api/typesGenerated";
import { Badge } from "components/Badge/Badge";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "components/Tooltip/Tooltip";
import type { FC } from "react";
import {
DATE_FORMAT,
@@ -16,34 +20,32 @@ export const WorkspaceDormantBadge: FC<WorkspaceDormantBadgeProps> = ({
workspace,
}) => {
return workspace.deleting_at ? (
<Tooltip
title={
<>
This workspace has not been used for{" "}
{relativeTimeWithoutSuffix(workspace.last_used_at)} and has been
marked dormant. It is scheduled to be deleted on{" "}
{formatDateTime(workspace.deleting_at, DATE_FORMAT.FULL_DATETIME)}.
</>
}
>
<Badge role="status" variant="destructive" size="xs">
Deletion Pending
</Badge>
<Tooltip>
<TooltipTrigger asChild>
<Badge role="status" variant="destructive" size="xs">
Deletion Pending
</Badge>
</TooltipTrigger>
<TooltipContent side="bottom" className="max-w-xs">
This workspace has not been used for{" "}
{relativeTimeWithoutSuffix(workspace.last_used_at)} and has been marked
dormant. It is scheduled to be deleted on{" "}
{formatDateTime(workspace.deleting_at, DATE_FORMAT.FULL_DATETIME)}.
</TooltipContent>
</Tooltip>
) : (
<Tooltip
title={
<>
This workspace has not been used for{" "}
{relativeTimeWithoutSuffix(workspace.last_used_at)} and has been
marked dormant. It is not scheduled for auto-deletion but will become
a candidate if auto-deletion is enabled on this template.
</>
}
>
<Badge role="status" variant="warning" size="xs">
Dormant
</Badge>
<Tooltip>
<TooltipTrigger asChild>
<Badge role="status" variant="warning" size="xs">
Dormant
</Badge>
</TooltipTrigger>
<TooltipContent side="bottom" className="max-w-xs">
This workspace has not been used for{" "}
{relativeTimeWithoutSuffix(workspace.last_used_at)} and has been marked
dormant. It is not scheduled for auto-deletion but will become a
candidate if auto-deletion is enabled on this template.
</TooltipContent>
</Tooltip>
);
};