File size: 2,877 Bytes
40c9336
3a909c0
9a9d18a
40c9336
 
 
 
 
 
 
3a909c0
 
 
 
 
 
 
 
 
 
 
9a9d18a
 
 
 
 
 
 
 
 
40c9336
 
9a9d18a
 
 
 
 
 
 
 
 
3a909c0
9a9d18a
 
 
42d8fb8
 
 
9a9d18a
 
 
 
 
 
 
 
 
 
40c9336
 
 
9a9d18a
 
 
40c9336
9a9d18a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3a909c0
9a9d18a
3a909c0
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React from "react";
import { Button } from "@/components/ui/button";
import { ArrowRight, AlertTriangle } from "lucide-react";
import {
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipTrigger,
} from "@/components/ui/tooltip";
import { Action } from "./types";

interface ActionListProps {
  actions: Action[];
  robotModel: string;
}

const ActionList: React.FC<ActionListProps> = ({ actions, robotModel }) => {
  const isLeKiwi = robotModel === "LeKiwi";
  const isDisabled = !robotModel || isLeKiwi;

  return (
    <TooltipProvider>
      <div className="pt-6">
        {!robotModel && (
          <p className="text-center text-gray-400 mb-4">
            Please select a robot model to continue.
          </p>
        )}
        {isLeKiwi && (
          <p className="text-center text-yellow-500 mb-4">
            LeKiwi model is not yet supported. Please select another model to
            continue.
          </p>
        )}
        <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
          {actions.map((action, index) => (
            <div
              key={index}
              className={`flex items-center justify-between p-4 bg-gray-800 rounded-lg border border-gray-700 transition-opacity ${
                isDisabled ? "opacity-50" : ""
              }`}
            >
              <div className="flex items-center gap-2">
                <div>
                  <div className="flex items-center gap-2">
                    <h3 className="font-semibold text-lg text-left">
                      {action.title}
                    </h3>
                    {action.isWorkInProgress && (
                      <div className="flex items-center gap-1">
                        <Tooltip>
                          <TooltipTrigger>
                            <AlertTriangle className="w-4 h-4 text-yellow-500" />
                          </TooltipTrigger>
                          <TooltipContent>
                            <p>Work in progress</p>
                          </TooltipContent>
                        </Tooltip>
                        <span className="text-yellow-500 text-xs font-medium">
                          Work in Progress
                        </span>
                      </div>
                    )}
                  </div>
                  <p className="text-gray-400 text-sm text-left">
                    {action.description}
                  </p>
                </div>
              </div>
              <Button
                onClick={action.handler}
                size="icon"
                className={`${action.color} text-white`}
                disabled={isDisabled}
              >
                <ArrowRight className="w-5 h-5" />
              </Button>
            </div>
          ))}
        </div>
      </div>
    </TooltipProvider>
  );
};

export default ActionList;