import { useState } from "react"; import { useParams } from "react-router-dom"; import { ActionScreenshot } from "./ActionScreenshot"; import { InputReasoningCard } from "./InputReasoningCard"; import { ScrollableActionList } from "./ScrollableActionList"; import { useActions } from "./useActions"; import { Skeleton } from "@/components/ui/skeleton"; function TaskActions() { const { taskId } = useParams(); const { data, isFetching } = useActions(taskId!); const [selectedActionIndex, setSelectedAction] = useState(0); const activeAction = data?.[selectedActionIndex]; if (isFetching || !data) { return (
); } if (!activeAction) { return
No action
; } return (
setSelectedAction((prev) => prev === data.length - 1 ? prev : prev + 1, ) } onPrevious={() => setSelectedAction((prev) => (prev === 0 ? prev : prev - 1)) } />
); } export { TaskActions };