File size: 940 Bytes
3baa9da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
'use client';

interface ModelInputProps {
  currentModel: string;
  onModelChange: (modelName: string) => void;
  onLoadModel: () => void;
  ready: boolean | null;
  defaultModel: string;
}

export const ModelInput = ({

  currentModel,

  onModelChange,

  onLoadModel,

  ready,

  defaultModel,

}: ModelInputProps) => {
  return (
    <div className="mb-8 flex flex-col md:flex-row items-center gap-4">

      <input

        type="text"

        className="flex-1 p-3 rounded-lg border border-gray-300"

        value={currentModel}

        onChange={(e) => onModelChange(e.target.value)}

        placeholder={`Enter model name (e.g. ${defaultModel})`}

      />

      <button

        className="px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition"

        onClick={onLoadModel}

        disabled={ready === false}

      >

        Load Model

      </button>

    </div>
  );
};