From 93ef692eb55a5f0e77be4c73abde88e02dcce030 Mon Sep 17 00:00:00 2001 From: RoyceDa Date: Thu, 9 Apr 2026 16:53:57 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B3=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D0=B3=D0=BE=D0=BB=D0=BE=D1=81=D0=BE=D0=B2?= =?UTF-8?q?=D1=8B=D1=85=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/DialogInput/DialogInput.tsx | 47 +++++++++++++++++-- .../PlayerProvider/PlayerProvider.tsx | 25 ++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 app/providers/PlayerProvider/PlayerProvider.tsx diff --git a/app/components/DialogInput/DialogInput.tsx b/app/components/DialogInput/DialogInput.tsx index 3999432..6a28fbb 100644 --- a/app/components/DialogInput/DialogInput.tsx +++ b/app/components/DialogInput/DialogInput.tsx @@ -1,7 +1,7 @@ import { useDialog } from "@/app/providers/DialogProvider/useDialog"; import { useRosettaColors } from "@/app/hooks/useRosettaColors"; import { Box, Divider, Flex, Menu, Popover, Text, Transition, useComputedColorScheme } from "@mantine/core"; -import { IconBarrierBlock, IconCamera, IconDoorExit, IconFile, IconMoodSmile, IconPaperclip, IconSend } from "@tabler/icons-react"; +import { IconBarrierBlock, IconCamera, IconDoorExit, IconFile, IconMicrophone, IconMoodSmile, IconPaperclip, IconSend } from "@tabler/icons-react"; import { useEffect, useRef, useState } from "react"; import { useBlacklist } from "@/app/providers/BlacklistProvider/useBlacklist"; import { filePrapareForNetworkTransfer, generateRandomKey, imagePrepareForNetworkTransfer } from "@/app/utils/utils"; @@ -64,6 +64,13 @@ export function DialogInput() { }] ], [], true); + const hasText = message.trim().length > 0; + const showSendIcon = hasText || attachments.length > 0; + + const onMicClick = () => { + console.info("Start voice record"); + }; + const fileDialog = useFileDialog({ multiple: false, //naccept: '*', @@ -435,9 +442,41 @@ export function DialogInput() { /> - + + + {(styles) => ( + + )} + + + + {(styles) => ( + + )} + + } {blocked && diff --git a/app/providers/PlayerProvider/PlayerProvider.tsx b/app/providers/PlayerProvider/PlayerProvider.tsx new file mode 100644 index 0000000..203bb48 --- /dev/null +++ b/app/providers/PlayerProvider/PlayerProvider.tsx @@ -0,0 +1,25 @@ +import { createContext, useRef } from "react"; + +const PlayerContext = createContext(null); +/** + * Провайдер для Audio/Video плеера + */ +interface PlayerProviderProps { + children: React.ReactNode; +} +export function PlayerProvider(props : PlayerProviderProps) { + + const audioRef = useRef(null); + + const playVoice = () => { + + } + + + return ( + + {props.children} + + ) +} \ No newline at end of file