Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@
import { useFlagValue } from "@/components/shared/Settings/useFlags";
import { withSuspenseWrapper } from "@/components/shared/SuspenseWrapper";
import { Icon } from "@/components/ui/icon";
import { InlineStack } from "@/components/ui/layout";
import { BlockStack, InlineStack } from "@/components/ui/layout";

Check failure on line 10 in src/components/shared/ReactFlow/FlowSidebar/components/ComponentItem.tsx

View workflow job for this annotation

GitHub Actions / Linting

'BlockStack' is defined but never used. Allowed unused vars must match /^_/u

Check failure on line 10 in src/components/shared/ReactFlow/FlowSidebar/components/ComponentItem.tsx

View workflow job for this annotation

GitHub Actions / Type checking

'BlockStack' is declared but its value is never read.
import { Skeleton } from "@/components/ui/skeleton";
import { Spinner } from "@/components/ui/spinner";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Text } from "@/components/ui/typography";

Check failure on line 18 in src/components/shared/ReactFlow/FlowSidebar/components/ComponentItem.tsx

View workflow job for this annotation

GitHub Actions / Linting

'Text' is defined but never used. Allowed unused vars must match /^_/u

Check failure on line 18 in src/components/shared/ReactFlow/FlowSidebar/components/ComponentItem.tsx

View workflow job for this annotation

GitHub Actions / Type checking

'Text' is declared but its value is never read.
import { useHydrateComponentReference } from "@/hooks/useHydrateComponentReference";
import { cn } from "@/lib/utils";
import { type ComponentReference, type TaskSpec } from "@/utils/componentSpec";
Expand Down Expand Up @@ -168,74 +174,78 @@
);

return (
<li
className={cn(
"pl-2 py-1.5 w-full",
error
? "cursor-not-allowed opacity-60"
: "cursor-grab hover:bg-gray-100 active:bg-gray-200",
)}
draggable={!error && !isLoading}
onDragStart={onDragStart}
>
<InlineStack gap="2" wrap="nowrap" className="w-full min-w-0">
{isLoading ? (
<span className="text-gray-400 truncate text-sm">Loading...</span>
) : error ? (
<span className="truncate text-xs text-red-500">
Error loading component
</span>
) : (
<InlineStack
wrap="nowrap"
className="w-full"
data-testid="component-item"
data-component-name={displayName}
>
<InlineStack gap="2" className="flex-1 min-w-0" wrap="nowrap">
{isRemoteComponentLibrarySearchEnabled ? (
<ComponentIcon
name={iconName}
className={iconClass}
component={component}
/>
) : (
<Icon name={iconName} className={iconClass} />
)}

<div
className="flex flex-col flex-1 min-w-0"
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={onMouseClick}
<Tooltip>
<TooltipTrigger asChild>
<li
className={cn(
"pl-2 py-1.5 w-full",
error
? "cursor-not-allowed opacity-60"
: "cursor-grab hover:bg-gray-100 active:bg-gray-200",
)}
draggable={!error && !isLoading}
onDragStart={onDragStart}
>
<InlineStack gap="2" wrap="nowrap" className="w-full min-w-0">
{isLoading ? (
<span className="text-gray-400 truncate text-sm">Loading...</span>
) : error ? (
<span className="truncate text-xs text-red-500">
Error loading component
</span>
) : (
<InlineStack
wrap="nowrap"
className="w-full"
data-testid="component-item"
data-component-name={displayName}
>
<span
className="truncate text-xs text-gray-800"
title={displayName}
>
{displayName}
</span>
{author && author.length > 0 && (
<span className="truncate text-[10px] text-gray-500 font-mono">
{author}
</span>
)}
<span className="truncate text-[10px] text-gray-500 font-mono">
Ver: {digest}
</span>
</div>
</InlineStack>
<InlineStack align="end" wrap="nowrap">
<ComponentFavoriteToggle component={component} />
<ComponentDetailsDialog
displayName={displayName}
component={component}
/>
</InlineStack>
<InlineStack gap="2" className="flex-1 min-w-0" wrap="nowrap">
{isRemoteComponentLibrarySearchEnabled ? (
<ComponentIcon
name={iconName}
className={iconClass}
component={component}
/>
) : (
<Icon name={iconName} className={iconClass} />
)}

<div
className="flex flex-col flex-1 min-w-0"
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={onMouseClick}
>
<span className="truncate text-xs text-gray-800">
{displayName}
</span>
{author && author.length > 0 && (
<span className="truncate text-[10px] text-gray-500 font-mono">
{author}
</span>
)}
<span className="truncate text-[10px] text-gray-500 font-mono">
Ver: {digest}
</span>
</div>
</InlineStack>
<InlineStack align="end" wrap="nowrap">
<ComponentFavoriteToggle component={component} />
<ComponentDetailsDialog
displayName={displayName}
component={component}
/>
</InlineStack>
</InlineStack>
)}
</InlineStack>
)}
</InlineStack>
</li>
</li>
</TooltipTrigger>
<TooltipContent side="right" sideOffset={8}>
{displayName}
</TooltipContent>
</Tooltip>
);
};

Expand Down
Loading