Skip to content

Commit dcd7ec1

Browse files
committed
update
1 parent 7a1ac84 commit dcd7ec1

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

site/app/tasks/page.tsx

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useState, useMemo, useEffect, Suspense } from "react";
4-
import { ChevronDown, ChevronRight, CheckCircle2, XCircle, Clock, Cpu, Search, AlertTriangle, ArrowUpDown, ArrowUp, ArrowDown, Filter, Coins, X } from "lucide-react";
4+
import { CheckCircle2, XCircle, Search, AlertTriangle, ArrowUpDown, ArrowUp, ArrowDown, Filter, X } from "lucide-react";
55
import Link from "next/link";
66
import { useRouter, useSearchParams, usePathname } from "next/navigation";
77
import { clsx, type ClassValue } from "clsx";
@@ -39,43 +39,6 @@ const tasksData = Object.entries(tasksDataRaw).map(([taskName, trials]) => {
3939
const allModels = Array.from(new Set(tasksData.flatMap(t => t.trials.map(tr => tr.model))));
4040
const allAgents = Array.from(new Set(tasksData.flatMap(t => t.trials.map(tr => tr.agent))));
4141

42-
function BackToTop() {
43-
const [isVisible, setIsVisible] = useState(false);
44-
45-
useEffect(() => {
46-
const toggleVisibility = () => {
47-
if (window.scrollY > 300) {
48-
setIsVisible(true);
49-
} else {
50-
setIsVisible(false);
51-
}
52-
};
53-
54-
window.addEventListener("scroll", toggleVisibility);
55-
return () => window.removeEventListener("scroll", toggleVisibility);
56-
}, []);
57-
58-
const scrollToTop = () => {
59-
window.scrollTo({
60-
top: 0,
61-
behavior: "smooth"
62-
});
63-
};
64-
65-
if (!isVisible) return null;
66-
67-
return (
68-
<button
69-
type="button"
70-
onClick={scrollToTop}
71-
className="fixed bottom-8 right-8 p-3 bg-secondary text-foreground rounded-full shadow-lg border border-border hover:bg-secondary/80 transition-all z-50 flex items-center justify-center group backdrop-blur-sm"
72-
aria-label="Back to top"
73-
>
74-
<ArrowUp className="w-5 h-5 group-hover:-translate-y-1 transition-transform" />
75-
</button>
76-
);
77-
}
78-
7942
function TasksContent() {
8043
const router = useRouter();
8144
const pathname = usePathname();
@@ -442,3 +405,40 @@ export default function TasksPage() {
442405
</div>
443406
);
444407
}
408+
409+
function BackToTop() {
410+
const [isVisible, setIsVisible] = useState(false);
411+
412+
useEffect(() => {
413+
const toggleVisibility = () => {
414+
if (window.scrollY > 300) {
415+
setIsVisible(true);
416+
} else {
417+
setIsVisible(false);
418+
}
419+
};
420+
421+
window.addEventListener("scroll", toggleVisibility);
422+
return () => window.removeEventListener("scroll", toggleVisibility);
423+
}, []);
424+
425+
const scrollToTop = () => {
426+
window.scrollTo({
427+
top: 0,
428+
behavior: "smooth"
429+
});
430+
};
431+
432+
if (!isVisible) return null;
433+
434+
return (
435+
<button
436+
type="button"
437+
onClick={scrollToTop}
438+
className="fixed bottom-8 right-8 p-3 bg-secondary text-foreground rounded-full shadow-lg border border-border hover:bg-secondary/80 transition-all z-50 flex items-center justify-center group backdrop-blur-sm"
439+
aria-label="Back to top"
440+
>
441+
<ArrowUp className="w-5 h-5 group-hover:-translate-y-1 transition-transform" />
442+
</button>
443+
);
444+
}

0 commit comments

Comments
 (0)