import { FileTreeEntity } from '../../../../../../types/file-tree-entity'
import { useTranslation } from 'react-i18next'
import { useProjectContext } from '@/shared/context/project-context'
import { useCallback } from 'react'
import { syncDelete } from '@/features/file-tree/util/sync-mutation'
import { Button } from 'react-bootstrap'
export function UploadConflicts({
cancel,
conflicts,
folderConflicts,
handleOverwrite,
setError,
}: {
cancel: () => void
conflicts: FileTreeEntity[]
folderConflicts: FileTreeEntity[]
handleOverwrite: () => void
setError: (error: string) => void
}) {
const { t } = useTranslation()
// ensure that no uploads happen while there are folder conflicts
if (folderConflicts.length > 0) {
return (
{t('the_following_files_already_exist_in_this_project')}
{t('do_you_want_to_overwrite_them')}
{t('the_following_folder_already_exists_in_this_project', { count: folderConflicts.length, })}
{t('overwriting_the_original_folder')}
{t('do_you_want_to_overwrite_it', {
count: folderConflicts.length,
})}