File size: 1,658 Bytes
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

import React from 'react';
import { Button } from "@/components/ui/button";
import { ArrowRight } from "lucide-react";
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 (
    <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="space-y-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>
              <h3 className="font-semibold text-lg">{action.title}</h3>
              <p className="text-gray-400 text-sm">
                {action.description}
              </p>
            </div>
            <Button
              onClick={action.handler}
              size="icon"
              className={`${action.color} text-white`}
              disabled={isDisabled}
            >
              <ArrowRight className="w-5 h-5" />
            </Button>
          </div>
        ))}
      </div>
    </div>
  );
};

export default ActionList;