atrokhym commited on
Commit
ccaa67b
·
1 Parent(s): 7cdb56a

adjusting spaces for X button in file-preview

Browse files
app/components/chat/FilePreview.tsx CHANGED
@@ -1,7 +1,5 @@
1
- // Remove the lucide-react import
2
  import React from 'react';
3
 
4
- // Rest of the interface remains the same
5
  interface FilePreviewProps {
6
  files: File[];
7
  imageDataList: string[];
@@ -14,19 +12,17 @@ const FilePreview: React.FC<FilePreviewProps> = ({ files, imageDataList, onRemov
14
  }
15
 
16
  return (
17
- <div className="flex flex-row overflow-x-auto">
18
  {files.map((file, index) => (
19
  <div key={file.name + file.size} className="mr-2 relative">
20
  {imageDataList[index] && (
21
- <div className="relative">
22
  <img src={imageDataList[index]} alt={file.name} className="max-h-20" />
23
  <button
24
  onClick={() => onRemove(index)}
25
- className="absolute -top-2 -right-2 z-10 bg-white rounded-full p-1 shadow-md hover:bg-gray-100"
26
  >
27
- <div className="bg-black rounded-full p-1">
28
- <div className="i-ph:x w-3 h-3 text-gray-400" />
29
- </div>
30
  </button>
31
  </div>
32
  )}
 
 
1
  import React from 'react';
2
 
 
3
  interface FilePreviewProps {
4
  files: File[];
5
  imageDataList: string[];
 
12
  }
13
 
14
  return (
15
+ <div className="flex flex-row overflow-x-auto -mt-2">
16
  {files.map((file, index) => (
17
  <div key={file.name + file.size} className="mr-2 relative">
18
  {imageDataList[index] && (
19
+ <div className="relative pt-4 pr-4">
20
  <img src={imageDataList[index]} alt={file.name} className="max-h-20" />
21
  <button
22
  onClick={() => onRemove(index)}
23
+ className="absolute top-1 right-1 z-10 bg-black rounded-full w-5 h-5 shadow-md hover:bg-gray-900 transition-colors flex items-center justify-center"
24
  >
25
+ <div className="i-ph:x w-3 h-3 text-gray-200" />
 
 
26
  </button>
27
  </div>
28
  )}