Обновлен Dockerfile для установки wget и добавлены зависимости в компонентах. Исправлены зависимости в хуках и компонентах, улучшено логирование и обработка ошибок. Удалены неиспользуемые импорты и оптимизированы некоторые функции. Обновлены компоненты для работы с изображениями и улучшена структура кода.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Paperclip, Image, X } from 'lucide-react'
|
||||
import NextImage from 'next/image'
|
||||
import { useAuth } from '@/hooks/useAuth'
|
||||
|
||||
interface FileUploaderProps {
|
||||
@ -118,9 +119,11 @@ export function FileUploader({ onSendFile }: FileUploaderProps) {
|
||||
<div className="flex items-center space-x-2 flex-1">
|
||||
{isImageType(selectedFile.type) ? (
|
||||
<div className="flex items-center space-x-2">
|
||||
<img
|
||||
<NextImage
|
||||
src={selectedFile.url}
|
||||
alt="Preview"
|
||||
width={40}
|
||||
height={40}
|
||||
className="w-10 h-10 object-cover rounded"
|
||||
/>
|
||||
<div>
|
||||
|
@ -1,6 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import { Download, Eye } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
|
||||
@ -44,9 +45,11 @@ export function ImageMessage({ imageUrl, fileName, fileSize, isCurrentUser = fal
|
||||
: 'bg-white/10 border border-white/20'
|
||||
} rounded-lg overflow-hidden`}>
|
||||
<div className="relative">
|
||||
<img
|
||||
<Image
|
||||
src={imageUrl}
|
||||
alt={fileName}
|
||||
width={300}
|
||||
height={300}
|
||||
className="w-full h-auto cursor-pointer transition-opacity duration-200"
|
||||
style={{
|
||||
opacity: isLoading ? 0 : 1,
|
||||
@ -108,9 +111,11 @@ export function ImageMessage({ imageUrl, fileName, fileSize, isCurrentUser = fal
|
||||
onClick={() => setShowFullSize(false)}
|
||||
>
|
||||
<div className="relative max-w-full max-h-full">
|
||||
<img
|
||||
<Image
|
||||
src={imageUrl}
|
||||
alt={fileName}
|
||||
width={800}
|
||||
height={600}
|
||||
className="max-w-full max-h-full object-contain"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
/>
|
||||
|
@ -16,7 +16,8 @@ const PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(
|
||||
onChange?.(value)
|
||||
}
|
||||
|
||||
// Фильтруем пропсы, которые могут конфликтовать с IMaskInput
|
||||
// Фильтруем пропсы, которые могут конфликтовать с IMaskInput
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { min, max, step, ...filteredProps } = props
|
||||
|
||||
return (
|
||||
@ -61,6 +62,7 @@ const GlassPhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(
|
||||
const isEmpty = !value || value.replace(/\D/g, '').length === 0
|
||||
|
||||
// Фильтруем пропсы, которые могут конфликтовать с IMaskInput
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { min, max, step, onFocus, onBlur, ...filteredProps } = props
|
||||
|
||||
return (
|
||||
|
@ -23,6 +23,7 @@ export function VoicePlayer({ audioUrl, duration = 0, isCurrentUser = false }: V
|
||||
if (duration > 0 && (!audioDuration || audioDuration === 0)) {
|
||||
setAudioDuration(duration)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [duration, audioDuration])
|
||||
|
||||
useEffect(() => {
|
||||
|
Reference in New Issue
Block a user