feat: enhance file selector with improved localization and functionality

- Updated localization files for multiple languages to include new strings related to file sharing and management.
- Enhanced the FileSelector component to support additional features such as file descriptions, search functionality, and improved user feedback.
- Refactored action button titles and placeholder texts to utilize localized strings for better user experience.
- Improved the display of file counts and selection statuses in the file selector interface.
This commit is contained in:
Daniel Luiz Alves
2025-06-02 17:05:01 -03:00
parent f067e160ba
commit bc752b3b74
15 changed files with 266 additions and 66 deletions

View File

@@ -84,12 +84,27 @@
},
"fileSelector": {
"availableFiles": "الملفات المتاحة ({count})",
"shareFiles": "مشاركة الملفات ({count})",
"searchPlaceholder": "ابحث عن الملفات...",
"shareFiles": "الملفات المشتركة ({count})",
"shareFilesDescription": "الملفات الموجودة حالياً في المشاركة",
"availableFilesDescription": "اختر الملفات لإضافتها إلى المشاركة",
"searchPlaceholder": "البحث في الملفات...",
"searchSelectedFiles": "البحث في الملفات المحددة...",
"noMatchingFiles": "لا توجد ملفات مطابقة",
"noAvailableFiles": "لا توجد ملفات متاحة",
"noFilesInShare": "لا توجد ملفات للمشاركة",
"saveChanges": "احفظ التغييرات"
"noFilesInShare": "لا توجد ملفات في المشاركة",
"noFilesFound": "لم يتم العثور على ملفات",
"noFilesFoundWith": "لم يتم العثور على ملفات تحتوي على \"{query}\"",
"addFilesFromList": "أضف ملفات من القائمة أدناه",
"tryDifferentSearch": "جرب مصطلحات بحث مختلفة",
"allFilesInShare": "جميع الملفات موجودة بالفعل في المشاركة",
"uploadNewFiles": "ارفع ملفات جديدة لإضافتها",
"fileCount": "{count, plural, =1 {ملف} other {ملفات}}",
"filesSelected": "{count, plural, =0 {لا توجد ملفات محددة} =1 {ملف واحد محدد} other {# ملفات محددة}}",
"editFile": "تعديل الملف",
"previewFile": "معاينة الملف",
"addToShare": "إضافة إلى المشاركة",
"removeFromShare": "إزالة من المشاركة",
"saveChanges": "حفظ التغييرات"
},
"files": {
"title": "جميع الملفات",

View File

@@ -84,12 +84,27 @@
},
"fileSelector": {
"availableFiles": "Verfügbare Dateien ({count})",
"shareFiles": "Dateien teilen ({count})",
"shareFiles": "Geteilte Dateien ({count})",
"shareFilesDescription": "Dateien derzeit in der Freigabe",
"availableFilesDescription": "Wählen Sie Dateien aus, um sie zur Freigabe hinzuzufügen",
"searchPlaceholder": "Dateien suchen...",
"noMatchingFiles": "Keine übereinstimmenden Dateien",
"searchSelectedFiles": "In ausgewählten Dateien suchen...",
"noMatchingFiles": "Keine passenden Dateien",
"noAvailableFiles": "Keine Dateien verfügbar",
"noFilesInShare": "Keine Dateien in der Freigabe",
"saveChanges": "Änderungen speichern"
"noFilesFound": "Keine Dateien gefunden",
"noFilesFoundWith": "Keine Dateien gefunden mit \"{query}\"",
"addFilesFromList": "Fügen Sie Dateien aus der unten stehenden Liste hinzu",
"tryDifferentSearch": "Versuchen Sie andere Suchbegriffe",
"allFilesInShare": "Alle Dateien sind bereits in der Freigabe",
"uploadNewFiles": "Laden Sie neue Dateien hoch, um sie hinzuzufügen",
"fileCount": "{count, plural, =1 {Datei} other {Dateien}}",
"filesSelected": "{count, plural, =0 {Keine Dateien ausgewählt} =1 {1 Datei ausgewählt} other {# Dateien ausgewählt}}",
"editFile": "Datei bearbeiten",
"previewFile": "Datei-Vorschau",
"addToShare": "Zur Freigabe hinzufügen",
"removeFromShare": "Aus Freigabe entfernen",
"saveChanges": "Änderungen Speichern"
},
"files": {
"title": "Alle Dateien",

View File

@@ -85,10 +85,25 @@
"fileSelector": {
"availableFiles": "Available Files ({count})",
"shareFiles": "Share Files ({count})",
"shareFilesDescription": "Files currently in the share",
"availableFilesDescription": "Select files to add to the share",
"searchPlaceholder": "Search files...",
"searchSelectedFiles": "Search selected files...",
"noMatchingFiles": "No matching files",
"noAvailableFiles": "No files available",
"noFilesInShare": "No files in share",
"noFilesFound": "No files found",
"noFilesFoundWith": "No files found with \"{query}\"",
"addFilesFromList": "Add files from the list below",
"tryDifferentSearch": "Try different search terms",
"allFilesInShare": "All files are already in the share",
"uploadNewFiles": "Upload new files to add them",
"fileCount": "{count, plural, =1 {file} other {files}}",
"filesSelected": "{count, plural, =0 {No files selected} =1 {1 file selected} other {# files selected}}",
"editFile": "Edit file",
"previewFile": "Preview file",
"addToShare": "Add to share",
"removeFromShare": "Remove from share",
"saveChanges": "Save Changes"
},
"files": {

View File

@@ -83,13 +83,28 @@
"loadingAudio": "Cargando audio..."
},
"fileSelector": {
"availableFiles": "Archivos disponibles ({count})",
"shareFiles": "Compartir archivos ({count})",
"availableFiles": "Archivos Disponibles ({count})",
"shareFiles": "Archivos Compartidos ({count})",
"shareFilesDescription": "Archivos actualmente en la compartición",
"availableFilesDescription": "Selecciona archivos para agregar a la compartición",
"searchPlaceholder": "Buscar archivos...",
"noMatchingFiles": "No hay archivos que coincidan",
"searchSelectedFiles": "Buscar en archivos seleccionados...",
"noMatchingFiles": "No se encontraron archivos coincidentes",
"noAvailableFiles": "No hay archivos disponibles",
"noFilesInShare": "No hay archivos compartidos",
"saveChanges": "Guardar cambios"
"noFilesInShare": "No hay archivos en la compartición",
"noFilesFound": "No se encontraron archivos",
"noFilesFoundWith": "No se encontraron archivos con \"{query}\"",
"addFilesFromList": "Agrega archivos de la lista a continuación",
"tryDifferentSearch": "Intenta con otros términos de búsqueda",
"allFilesInShare": "Todos los archivos ya están en la compartición",
"uploadNewFiles": "Sube nuevos archivos para agregarlos",
"fileCount": "{count, plural, =1 {archivo} other {archivos}}",
"filesSelected": "{count, plural, =0 {Ningún archivo seleccionado} =1 {1 archivo seleccionado} other {# archivos seleccionados}}",
"editFile": "Editar archivo",
"previewFile": "Vista previa del archivo",
"addToShare": "Agregar a compartición",
"removeFromShare": "Quitar de compartición",
"saveChanges": "Guardar Cambios"
},
"files": {
"title": "Todos los Archivos",

View File

@@ -85,11 +85,26 @@
"fileSelector": {
"availableFiles": "Fichiers Disponibles ({count})",
"shareFiles": "Fichiers Partagés ({count})",
"shareFilesDescription": "Fichiers actuellement dans le partage",
"availableFilesDescription": "Sélectionnez des fichiers à ajouter au partage",
"searchPlaceholder": "Rechercher des fichiers...",
"searchSelectedFiles": "Rechercher dans les fichiers sélectionnés...",
"noMatchingFiles": "Aucun fichier correspondant",
"noAvailableFiles": "Aucun fichier disponible",
"noFilesInShare": "Aucun fichier partagé",
"saveChanges": "Enregistrer les Modifications"
"noFilesInShare": "Aucun fichier dans le partage",
"noFilesFound": "Aucun fichier trouvé",
"noFilesFoundWith": "Aucun fichier trouvé avec \"{query}\"",
"addFilesFromList": "Ajoutez des fichiers de la liste ci-dessous",
"tryDifferentSearch": "Essayez d'autres termes de recherche",
"allFilesInShare": "Tous les fichiers sont déjà dans le partage",
"uploadNewFiles": "Téléchargez de nouveaux fichiers pour les ajouter",
"fileCount": "{count, plural, =1 {fichier} other {fichiers}}",
"filesSelected": "{count, plural, =0 {Aucun fichier sélectionné} =1 {1 fichier sélectionné} other {# fichiers sélectionnés}}",
"editFile": "Modifier le fichier",
"previewFile": "Aperçu du fichier",
"addToShare": "Ajouter au partage",
"removeFromShare": "Retirer du partage",
"saveChanges": "Sauvegarder les Modifications"
},
"files": {
"title": "Tous les Fichiers",

View File

@@ -84,11 +84,26 @@
},
"fileSelector": {
"availableFiles": "उपलब्ध फाइलें ({count})",
"shareFiles": "फाइलें साझा करें ({count})",
"searchPlaceholder": "फाइलें खोजें...",
"noMatchingFiles": "कोई मेल खाने वाली फाइलें नहीं",
"noAvailableFiles": "कोई फाइल उपलब्ध नहीं",
"shareFiles": "साझा फाइलें ({count})",
"shareFilesDescription": "वर्तमान में साझाकरण में फाइलें",
"availableFilesDescription": "साझाकरण में जोड़ने के लिए फाइलें चुनें",
"searchPlaceholder": "फाइलों की खोज करें...",
"searchSelectedFiles": "चयनित फाइलों में खोजें...",
"noMatchingFiles": "कोई मिलती जुलती फाइलें नहीं",
"noAvailableFiles": "कोई उपलब्ध फाइलें नहीं",
"noFilesInShare": "साझाकरण में कोई फाइलें नहीं",
"noFilesFound": "कोई फाइलें नहीं मिलीं",
"noFilesFoundWith": "\"{query}\" वाली कोई फाइलें नहीं मिलीं",
"addFilesFromList": "नीचे की सूची से फाइलें जोड़ें",
"tryDifferentSearch": "अलग खोज शब्दों का प्रयास करें",
"allFilesInShare": "सभी फाइलें पहले से साझाकरण में हैं",
"uploadNewFiles": "जोड़ने के लिए नई फाइलें अपलोड करें",
"fileCount": "{count} फाइलें",
"filesSelected": "{count, plural, =0 {कोई फाइल चयनित नहीं} =1 {1 फाइल चयनित} other {# फाइलें चयनित}}",
"editFile": "फाइल संपादित करें",
"previewFile": "फाइल पूर्वावलोकन",
"addToShare": "साझाकरण में जोड़ें",
"removeFromShare": "साझाकरण से हटाएं",
"saveChanges": "परिवर्तन सहेजें"
},
"files": {

View File

@@ -84,11 +84,26 @@
},
"fileSelector": {
"availableFiles": "File Disponibili ({count})",
"shareFiles": "Condividi File ({count})",
"shareFiles": "File Condivisi ({count})",
"shareFilesDescription": "File attualmente nella condivisione",
"availableFilesDescription": "Seleziona i file da aggiungere alla condivisione",
"searchPlaceholder": "Cerca file...",
"searchSelectedFiles": "Cerca nei file selezionati...",
"noMatchingFiles": "Nessun file corrispondente",
"noAvailableFiles": "Nessun file disponibile",
"noFilesInShare": "Nessun file nella condivisione",
"noFilesFound": "Nessun file trovato",
"noFilesFoundWith": "Nessun file trovato con \"{query}\"",
"addFilesFromList": "Aggiungi file dalla lista sottostante",
"tryDifferentSearch": "Prova termini di ricerca diversi",
"allFilesInShare": "Tutti i file sono già nella condivisione",
"uploadNewFiles": "Carica nuovi file per aggiungerli",
"fileCount": "{count, plural, =1 {file} other {file}}",
"filesSelected": "{count, plural, =0 {Nessun file selezionato} =1 {1 file selezionato} other {# file selezionati}}",
"editFile": "Modifica file",
"previewFile": "Anteprima file",
"addToShare": "Aggiungi alla condivisione",
"removeFromShare": "Rimuovi dalla condivisione",
"saveChanges": "Salva Modifiche"
},
"files": {

View File

@@ -84,11 +84,26 @@
},
"fileSelector": {
"availableFiles": "利用可能なファイル ({count})",
"shareFiles": "ファイルを共有 ({count})",
"shareFiles": "共有ファイル ({count})",
"shareFilesDescription": "現在共有されているファイル",
"availableFilesDescription": "共有に追加するファイルを選択",
"searchPlaceholder": "ファイルを検索...",
"searchSelectedFiles": "選択されたファイルを検索...",
"noMatchingFiles": "一致するファイルがありません",
"noAvailableFiles": "利用可能なファイルがありません",
"noFilesInShare": "共有ファイルがありません",
"noFilesInShare": "共有ファイルがありません",
"noFilesFound": "ファイルが見つかりませんでした",
"noFilesFoundWith": "\"{query}\"に一致するファイルが見つかりません",
"addFilesFromList": "下のリストからファイルを追加",
"tryDifferentSearch": "別の検索用語を試してください",
"allFilesInShare": "すべてのファイルが既に共有されています",
"uploadNewFiles": "新しいファイルをアップロードして追加",
"fileCount": "{count}ファイル",
"filesSelected": "{count, plural, =0 {ファイルが選択されていません} other {#ファイルが選択されています}}",
"editFile": "ファイルを編集",
"previewFile": "ファイルをプレビュー",
"addToShare": "共有に追加",
"removeFromShare": "共有から削除",
"saveChanges": "変更を保存"
},
"files": {

View File

@@ -84,12 +84,27 @@
},
"fileSelector": {
"availableFiles": "사용 가능한 파일 ({count})",
"shareFiles": "파일 공유 ({count})",
"shareFiles": "공유 파일 ({count})",
"shareFilesDescription": "현재 공유 중인 파일",
"availableFilesDescription": "공유에 추가할 파일을 선택하세요",
"searchPlaceholder": "파일 검색...",
"searchSelectedFiles": "선택된 파일에서 검색...",
"noMatchingFiles": "일치하는 파일이 없습니다",
"noAvailableFiles": "사용 가능한 파일이 없습니다",
"noFilesInShare": "공유 파일이 없습니다",
"saveChanges": "변경 사항 저장"
"noFilesInShare": "공유 파일이 없습니다",
"noFilesFound": "파일을 찾을 수 없습니다",
"noFilesFoundWith": "\"{query}\"와 일치하는 파일을 찾을 수 없습니다",
"addFilesFromList": "아래 목록에서 파일을 추가하세요",
"tryDifferentSearch": "다른 검색어를 시도해보세요",
"allFilesInShare": "모든 파일이 이미 공유되었습니다",
"uploadNewFiles": "새 파일을 업로드하여 추가하세요",
"fileCount": "{count}파일",
"filesSelected": "{count, plural, =0 {선택된 파일 없음} other {#파일 선택됨}}",
"editFile": "파일 편집",
"previewFile": "파일 미리보기",
"addToShare": "공유에 추가",
"removeFromShare": "공유에서 제거",
"saveChanges": "변경사항 저장"
},
"files": {
"title": "모든 파일",

View File

@@ -84,11 +84,26 @@
},
"fileSelector": {
"availableFiles": "Beschikbare Bestanden ({count})",
"shareFiles": "Bestanden Delen ({count})",
"searchPlaceholder": "Bestanden zoeken...",
"shareFiles": "Gedeelde Bestanden ({count})",
"shareFilesDescription": "Bestanden momenteel in de share",
"availableFilesDescription": "Selecteer bestanden om toe te voegen aan de share",
"searchPlaceholder": "Zoek bestanden...",
"searchSelectedFiles": "Zoek in geselecteerde bestanden...",
"noMatchingFiles": "Geen overeenkomende bestanden",
"noAvailableFiles": "Geen beschikbare bestanden",
"noFilesInShare": "Geen bestanden in delen",
"noAvailableFiles": "Geen bestanden beschikbaar",
"noFilesInShare": "Geen bestanden in share",
"noFilesFound": "Geen bestanden gevonden",
"noFilesFoundWith": "Geen bestanden gevonden met \"{query}\"",
"addFilesFromList": "Voeg bestanden toe uit de onderstaande lijst",
"tryDifferentSearch": "Probeer andere zoektermen",
"allFilesInShare": "Alle bestanden zijn al in de share",
"uploadNewFiles": "Upload nieuwe bestanden om ze toe te voegen",
"fileCount": "{count, plural, =1 {bestand} other {bestanden}}",
"filesSelected": "{count, plural, =0 {Geen bestanden geselecteerd} =1 {1 bestand geselecteerd} other {# bestanden geselecteerd}}",
"editFile": "Bestand bewerken",
"previewFile": "Bestand bekijken",
"addToShare": "Toevoegen aan share",
"removeFromShare": "Verwijderen uit share",
"saveChanges": "Wijzigingen Opslaan"
},
"files": {

View File

@@ -85,10 +85,25 @@
"fileSelector": {
"availableFiles": "Arquivos Disponíveis ({count})",
"shareFiles": "Arquivos Compartilhados ({count})",
"shareFilesDescription": "Arquivos atualmente no compartilhamento",
"availableFilesDescription": "Selecione arquivos para adicionar ao compartilhamento",
"searchPlaceholder": "Buscar arquivos...",
"searchSelectedFiles": "Buscar nos arquivos selecionados...",
"noMatchingFiles": "Nenhum arquivo encontrado",
"noAvailableFiles": "Nenhum arquivo disponível",
"noFilesInShare": "Nenhum arquivo compartilhado",
"noFilesInShare": "Nenhum arquivo no compartilhamento",
"noFilesFound": "Nenhum arquivo encontrado",
"noFilesFoundWith": "Nenhum arquivo encontrado com \"{query}\"",
"addFilesFromList": "Adicione arquivos da lista abaixo",
"tryDifferentSearch": "Tente usar outros termos de busca",
"allFilesInShare": "Todos os arquivos já estão no compartilhamento",
"uploadNewFiles": "Faça upload de novos arquivos para adicioná-los",
"fileCount": "{count, plural, =1 {arquivo} other {arquivos}}",
"filesSelected": "{count, plural, =0 {Nenhum arquivo selecionado} =1 {1 arquivo selecionado} other {# arquivos selecionados}}",
"editFile": "Editar arquivo",
"previewFile": "Visualizar arquivo",
"addToShare": "Adicionar ao compartilhamento",
"removeFromShare": "Remover do compartilhamento",
"saveChanges": "Salvar Alterações"
},
"files": {

View File

@@ -83,13 +83,28 @@
"loadingAudio": "Загрузка аудио..."
},
"fileSelector": {
"availableFiles": "Доступные файлы ({count})",
"shareFiles": "Поделиться файлами ({count})",
"availableFiles": "Доступные Файлы ({count})",
"shareFiles": "Общие Файлы ({count})",
"shareFilesDescription": "Файлы в текущем общем доступе",
"availableFilesDescription": "Выберите файлы для добавления в общий доступ",
"searchPlaceholder": "Поиск файлов...",
"noMatchingFiles": "Нет файлов, соответствующих запросу",
"searchSelectedFiles": "Поиск в выбранных файлах...",
"noMatchingFiles": "Нет подходящих файлов",
"noAvailableFiles": "Нет доступных файлов",
"noFilesInShare": "Нет файлов для совместного использования",
"saveChanges": "Сохранить изменения"
"noFilesInShare": "Нет файлов в общем доступе",
"noFilesFound": "Файлы не найдены",
"noFilesFoundWith": "Файлы не найдены по запросу \"{query}\"",
"addFilesFromList": "Добавьте файлы из списка ниже",
"tryDifferentSearch": "Попробуйте другие поисковые термины",
"allFilesInShare": "Все файлы уже в общем доступе",
"uploadNewFiles": "Загрузите новые файлы для добавления",
"fileCount": "{count, plural, =1 {файл} =2 {файла} =3 {файла} =4 {файла} other {файлов}}",
"filesSelected": "{count, plural, =0 {Файлы не выбраны} =1 {Выбран 1 файл} other {Выбрано # файлов}}",
"editFile": "Редактировать файл",
"previewFile": "Предпросмотр файла",
"addToShare": "Добавить в общий доступ",
"removeFromShare": "Удалить из общего доступа",
"saveChanges": "Сохранить Изменения"
},
"files": {
"title": "Все файлы",

View File

@@ -83,12 +83,27 @@
"loadingAudio": "Ses yükleniyor..."
},
"fileSelector": {
"availableFiles": "Kullanılabilir Dosyalar ({count})",
"shareFiles": "Dosyaları Paylaş ({count})",
"searchPlaceholder": "Dosya ara...",
"noMatchingFiles": "Eşleşen dosya bulunamadı",
"noAvailableFiles": "Kullanılabilir dosya yok",
"availableFiles": "Mevcut Dosyalar ({count})",
"shareFiles": "Paylaşılan Dosyalar ({count})",
"shareFilesDescription": "Şu anda paylaşımda olan dosyalar",
"availableFilesDescription": "Paylaşıma eklemek için dosyaları seçin",
"searchPlaceholder": "Dosyaları ara...",
"searchSelectedFiles": "Seçilen dosyalarda ara...",
"noMatchingFiles": "Eşleşen dosya yok",
"noAvailableFiles": "Mevcut dosya yok",
"noFilesInShare": "Paylaşımda dosya yok",
"noFilesFound": "Dosya bulunamadı",
"noFilesFoundWith": "\"{query}\" içeren dosya bulunamadı",
"addFilesFromList": "Aşağıdaki listeden dosyalar ekleyin",
"tryDifferentSearch": "Farklı arama terimleri deneyin",
"allFilesInShare": "Tüm dosyalar zaten paylaşımda",
"uploadNewFiles": "Eklemek için yeni dosyalar yükleyin",
"fileCount": "{count} dosya",
"filesSelected": "{count, plural, =0 {Seçilen dosya yok} =1 {1 dosya seçildi} other {# dosya seçildi}}",
"editFile": "Dosyayı düzenle",
"previewFile": "Dosyayı önizle",
"addToShare": "Paylaşıma ekle",
"removeFromShare": "Paylaşımdan kaldır",
"saveChanges": "Değişiklikleri Kaydet"
},
"files": {

View File

@@ -85,10 +85,25 @@
"fileSelector": {
"availableFiles": "可用文件 ({count})",
"shareFiles": "共享文件 ({count})",
"shareFilesDescription": "当前共享中的文件",
"availableFilesDescription": "选择要添加到共享的文件",
"searchPlaceholder": "搜索文件...",
"searchSelectedFiles": "在已选文件中搜索...",
"noMatchingFiles": "没有匹配的文件",
"noAvailableFiles": "没有可用文件",
"noAvailableFiles": "没有可用文件",
"noFilesInShare": "共享中没有文件",
"noFilesFound": "未找到文件",
"noFilesFoundWith": "未找到包含\"{query}\"的文件",
"addFilesFromList": "从下面的列表中添加文件",
"tryDifferentSearch": "尝试其他搜索词",
"allFilesInShare": "所有文件都已在共享中",
"uploadNewFiles": "上传新文件以添加",
"fileCount": "{count}个文件",
"filesSelected": "{count, plural, =0 {未选择文件} other {已选择#个文件}}",
"editFile": "编辑文件",
"previewFile": "预览文件",
"addToShare": "添加到共享",
"removeFromShare": "从共享中移除",
"saveChanges": "保存更改"
},
"files": {

View File

@@ -130,7 +130,6 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
<div className="text-xs text-muted-foreground">{formatFileSize(file.size)}</div>
</div>
<div className="flex items-center gap-2">
{/* Botões de ações secundárias */}
<div className="flex gap-1">
{onEditFile && (
<Button
@@ -138,7 +137,7 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
variant="ghost"
className="h-7 w-7 hover:bg-muted transition-colors"
onClick={() => setFileToEdit(file)}
title="Editar arquivo"
title={t("fileSelector.editFile")}
>
<IconEdit className="h-4 w-4" />
</Button>
@@ -148,20 +147,19 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
variant="ghost"
className="h-7 w-7 hover:bg-muted transition-colors"
onClick={() => setPreviewFile(file)}
title="Visualizar arquivo"
title={t("fileSelector.previewFile")}
>
<IconEye className="h-4 w-4" />
</Button>
</div>
{/* Botão de ação principal destacado */}
<div className="ml-1">
<Button
size="icon"
variant={isInShare ? "destructive" : "default"}
className="h-8 w-8 transition-all"
onClick={() => (isInShare ? removeFromShare(file.id) : addToShare(file.id))}
title={isInShare ? "Remover do compartilhamento" : "Adicionar ao compartilhamento"}
title={isInShare ? t("fileSelector.removeFromShare") : t("fileSelector.addToShare")}
>
{isInShare ? <IconMinus className="h-4 w-4" /> : <IconPlus className="h-4 w-4" />}
</Button>
@@ -174,24 +172,22 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
return (
<>
<div className="space-y-6">
{/* Current Files in Share */}
<div className="space-y-4">
<div className="flex items-center justify-between">
<div>
<h3 className="text-lg font-medium">{t("fileSelector.shareFiles", { count: shareFiles.length })}</h3>
<p className="text-sm text-muted-foreground">Arquivos atualmente no compartilhamento</p>
<p className="text-sm text-muted-foreground">{t("fileSelector.shareFilesDescription")}</p>
</div>
<Badge variant="secondary" className="bg-blue-500/20 text-blue-700">
{shareFiles.length} {shareFiles.length === 1 ? "arquivo" : "arquivos"}
{shareFiles.length} {t("fileSelector.fileCount", { count: shareFiles.length })}
</Badge>
</div>
{/* Search for selected files - only show if there are files */}
{shareFiles.length > 0 && (
<div className="relative">
<IconSearch className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input
placeholder="Buscar nos arquivos selecionados..."
placeholder={t("fileSelector.searchSelectedFiles")}
value={shareSearchFilter}
onChange={(e) => setShareSearchFilter(e.target.value)}
className="pl-10"
@@ -206,31 +202,29 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
))}
{filteredShareFiles.length === 0 && shareSearchFilter && (
<div className="text-center py-4 text-muted-foreground">
<p className="text-sm">Nenhum arquivo encontrado com "{shareSearchFilter}"</p>
<p className="text-sm">{t("fileSelector.noFilesFoundWith", { query: shareSearchFilter })}</p>
</div>
)}
</div>
) : (
<div className="text-center py-8 text-muted-foreground border rounded-lg bg-muted/20">
<div className="text-4xl mb-2">📁</div>
<p className="font-medium">Nenhum arquivo no compartilhamento</p>
<p className="text-sm">Adicione arquivos da lista abaixo</p>
<p className="font-medium">{t("fileSelector.noFilesInShare")}</p>
<p className="text-sm">{t("fileSelector.addFilesFromList")}</p>
</div>
)}
</div>
{/* Available Files to Add */}
<div className="space-y-4">
<div className="flex items-center justify-between">
<div>
<h3 className="text-lg font-medium">
{t("fileSelector.availableFiles", { count: filteredAvailableFiles.length })}
</h3>
<p className="text-sm text-muted-foreground">Selecione arquivos para adicionar ao compartilhamento</p>
<p className="text-sm text-muted-foreground">{t("fileSelector.availableFilesDescription")}</p>
</div>
</div>
{/* Search */}
<div className="relative">
<IconSearch className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input
@@ -241,7 +235,6 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
/>
</div>
{/* Available Files Grid */}
{filteredAvailableFiles.length > 0 ? (
<div className="grid gap-2 max-h-60 overflow-y-auto border rounded-lg p-3 bg-muted/10">
{filteredAvailableFiles.map((file) => (
@@ -251,28 +244,27 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
) : searchFilter ? (
<div className="text-center py-8 text-muted-foreground border rounded-lg bg-muted/20">
<div className="text-4xl mb-2">🔍</div>
<p className="font-medium">Nenhum arquivo encontrado</p>
<p className="text-sm">Tente usar outros termos de busca</p>
<p className="font-medium">{t("fileSelector.noFilesFound")}</p>
<p className="text-sm">{t("fileSelector.tryDifferentSearch")}</p>
</div>
) : (
<div className="text-center py-8 text-muted-foreground border rounded-lg bg-muted/20">
<div className="text-4xl mb-2">📄</div>
<p className="font-medium">Todos os arquivos estão no compartilhamento</p>
<p className="text-sm">Faça upload de novos arquivos para adicioná-los</p>
<p className="font-medium">{t("fileSelector.allFilesInShare")}</p>
<p className="text-sm">{t("fileSelector.uploadNewFiles")}</p>
</div>
)}
</div>
{/* Actions */}
<div className="flex items-center justify-between pt-4 border-t">
<div className="text-sm text-muted-foreground">
{shareFiles.length} {shareFiles.length === 1 ? "arquivo" : "arquivos"} selecionado(s)
{t("fileSelector.filesSelected", { count: shareFiles.length })}
</div>
<Button onClick={handleSave} disabled={isLoading} className="gap-2">
{isLoading ? (
<>
<div className="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" />
Salvando...
{t("common.saving")}
</>
) : (
<>
@@ -284,14 +276,12 @@ export function FileSelector({ shareId, selectedFiles, onSave, onEditFile }: Fil
</div>
</div>
{/* File Preview Dialog */}
<FilePreviewModal
isOpen={!!previewFile}
onClose={() => setPreviewFile(null)}
file={previewFile || { name: "", objectName: "" }}
/>
{/* File Edit Dialog */}
<FileActionsModals
fileToRename={fileToEdit}
fileToDelete={null}