Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Tooltip component by adding CircleHelp icon and fix instructions in script component #910

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/app/scripts/_components/ScriptItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function ScriptItem({
<div className="mt-4 rounded-lg border bg-accent/50">
<div className="flex gap-3 px-4 py-2">
<h2 className="text-lg font-semibold">
How to {item.type ? "install" : "use"}
How to {item.type == "misc" ? "use" : "install"}
</h2>
<Tooltips item={item} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ export default function InstallCommand({ item }: { item: Script }) {
time and minimal system resource usage. You are also obliged to
adhere to updates provided by the package maintainer.
</>
) : item.type ? (
) : item.type == "misc" ? (
<>
To create a new Proxmox VE {item.name}{" "}
{getDisplayValueFromType(item.type)}, run the command below in the
Proxmox VE Shell.
To use the {item.name} script, run the command below in the shell.
</>
) : (
<>
To use the {item.name} script, run the command below in the shell.
{" "}
To create a new Proxmox VE {item.name}{" "}
{getDisplayValueFromType(item.type)}, run the command below in the
Proxmox VE Shell.
</>
)}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Script } from "@/lib/types";
import { CircleHelp } from "lucide-react";
import React from "react";

interface TooltipProps {
Expand All @@ -18,9 +19,11 @@ const TooltipBadge: React.FC<TooltipProps> = ({ variant, label, content }) => (
<TooltipProvider>
<Tooltip delayDuration={100}>
<TooltipTrigger className="flex items-center">
<Badge variant={variant}>{label}</Badge>
<Badge variant={variant} className="flex items-center gap-1">
{label} <CircleHelp className="size-3" />
</Badge>
</TooltipTrigger>
<TooltipContent side="bottom" className="text-sm">
<TooltipContent side="bottom" className="text-sm max-w-64">
{content}
</TooltipContent>
</Tooltip>
Expand Down
Loading