Skip to content

Commit

Permalink
feat(dashboard): fix on hover regression
Browse files Browse the repository at this point in the history
  • Loading branch information
djabarovgeorge committed Jan 28, 2025
1 parent c778234 commit f53a108
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 26 deletions.
60 changes: 35 additions & 25 deletions apps/dashboard/src/components/workflow-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,40 @@ interface WorkflowListProps {
onClearFilters?: () => void;
}

interface WorkflowListSkeletonProps {
limit: number;
}

function WorkflowListSkeleton({ limit }: WorkflowListSkeletonProps) {
return (
<>
{new Array(limit).fill(0).map((_, index) => (
<TableRow key={index}>
<TableCell className="flex flex-col gap-1 font-medium">
<Skeleton className="h-5 w-[20ch]" />
<Skeleton className="h-3 w-[15ch] rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-5 w-[6ch] rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-5 w-[8ch] rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-5 w-[7ch] rounded-full" />
</TableCell>
<TableCell className="text-foreground-600 text-sm font-medium">
<Skeleton className="h-5 w-[14ch] rounded-full" />
</TableCell>
<TableCell className="text-foreground-600 text-sm font-medium">
<RiMore2Fill className="size-4 opacity-50" />
</TableCell>
</TableRow>
))}
</>
);
}

export function WorkflowList({
data,
isLoading,
Expand Down Expand Up @@ -100,31 +134,7 @@ export function WorkflowList({
</TableHeader>
<TableBody>
{isLoading ? (
<>
{new Array(limit).fill(0).map((_, index) => (
<TableRow key={index}>
<TableCell className="flex flex-col gap-1 font-medium">
<Skeleton className="h-5 w-[20ch]" />
<Skeleton className="h-3 w-[15ch] rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-5 w-[6ch] rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-5 w-[8ch] rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-5 w-[7ch] rounded-full" />
</TableCell>
<TableCell className="text-foreground-600 text-sm font-medium">
<Skeleton className="h-5 w-[14ch] rounded-full" />
</TableCell>
<TableCell className="text-foreground-600 text-sm font-medium">
<RiMore2Fill className="size-4 opacity-50" />
</TableCell>
</TableRow>
))}
</>
<WorkflowListSkeleton limit={limit} />
) : (
<>{data?.workflows.map((workflow) => <WorkflowRow key={workflow._id} workflow={workflow} />)}</>
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/workflow-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const WorkflowRow = ({ workflow }: WorkflowRowProps) => {
</WorkflowLinkTableCell>

<WorkflowLinkTableCell workflow={workflow} className="text-foreground-600 min-w-[180px] text-sm font-medium">
<TimeDisplayHoverCard date={new Date(workflow.updatedAt)}>
<TimeDisplayHoverCard date={new Date(workflow.updatedAt)} className="relative z-10">
{formatDateSimple(workflow.updatedAt)}
</TimeDisplayHoverCard>
</WorkflowLinkTableCell>
Expand Down

0 comments on commit f53a108

Please sign in to comment.