File size: 967 Bytes
9b63060
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import React from 'react';
import { X } from 'lucide-react';
import { Button } from '@/components/ui/button';

interface SummaryPanelProps {
  summary: string;
  isVisible: boolean;
  onClose: () => void;
}

const SummaryPanel = ({ summary, isVisible, onClose }: SummaryPanelProps) => {
  if (!isVisible) return null;

  return (
    <div className="fixed top-52 left-4 z-[9999] bg-white rounded-lg shadow-lg border border-gray-200 p-4 w-80 max-h-40 overflow-auto">
      <div className="flex items-center justify-between mb-3">
        <div className="font-semibold text-sm text-gray-700">Page Summary</div>
        <Button variant="ghost" size="sm" onClick={onClose} className="p-1 h-auto">
          <X className="w-4 h-4" />
        </Button>
      </div>
      <pre className="text-xs font-mono text-gray-600 whitespace-pre-wrap bg-gray-50 p-3 rounded border-l-4 border-blue-500">
        {summary}
      </pre>
    </div>
  );
};

export default SummaryPanel;