File size: 994 Bytes
21d7fc3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import CopyCodeButton from './CopyCodeButton';

export default function CodePanel({ modelResponse, generatedCode }) {
  return (
    <div 
      className="w-full max-w-[500px] lg:max-w-none lg:w-[500px] bg-gray-100 p-4 rounded-[26px] overflow-auto opacity-0 animate-fadeIn relative" 
      style={{ 
        height: 'min(calc(782px), 90vh)',
        animation: 'fadeIn 0.5s ease-in-out forwards'
      }}
    >
      <pre 
        className="text-sm whitespace-pre-wrap break-words font-mono h-full"
        style={{ 
          fontFamily: 'Menlo, Monaco, Consolas, monospace',
          padding: '16px',
          overflowY: 'auto'
        }}
      >
        {modelResponse && (
          <>
            <span className="font-semibold">Model Reasoning:</span>
            {'\n' + modelResponse + '\n\n\n'}
          </>
        )}
        <span className="font-semibold">Code:</span>
        {'\n' + generatedCode}
      </pre>
      <CopyCodeButton code={generatedCode} />
    </div>
  );
}