Spaces:
Sleeping
Sleeping
Merge branch #enzostvs/deepsite' into 'nomadicsynth/deepsite'
Browse files- LICENSE +22 -0
- src/components/ask-ai/ask-ai.tsx +16 -1
LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2025 DeepSite
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person
|
| 4 |
+
obtaining a copy of this software and associated documentation
|
| 5 |
+
files (the "Software"), to deal in the Software without
|
| 6 |
+
restriction, including without limitation the rights to use,
|
| 7 |
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 8 |
+
copies of the Software, and to permit persons to whom the
|
| 9 |
+
Software is furnished to do so, subject to the following
|
| 10 |
+
conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be
|
| 13 |
+
included in all copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 16 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
| 17 |
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 18 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
| 19 |
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
| 20 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 21 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
| 22 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
src/components/ask-ai/ask-ai.tsx
CHANGED
|
@@ -4,8 +4,9 @@ import { RiSparkling2Fill } from "react-icons/ri";
|
|
| 4 |
import { GrSend } from "react-icons/gr";
|
| 5 |
import classNames from "classnames";
|
| 6 |
import { toast } from "react-toastify";
|
| 7 |
-
import { useLocalStorage } from "react-use";
|
| 8 |
import { MdPreview } from "react-icons/md";
|
|
|
|
| 9 |
|
| 10 |
import Login from "../login/login";
|
| 11 |
import { defaultHTML } from "./../../../utils/consts";
|
|
@@ -39,6 +40,8 @@ function AskAI({
|
|
| 39 |
const [openProvider, setOpenProvider] = useState(false);
|
| 40 |
const [providerError, setProviderError] = useState("");
|
| 41 |
const [openProModal, setOpenProModal] = useState(false);
|
|
|
|
|
|
|
| 42 |
|
| 43 |
const audio = new Audio(SuccessSound);
|
| 44 |
audio.volume = 0.5;
|
|
@@ -148,6 +151,18 @@ function AskAI({
|
|
| 148 |
isAiWorking ? "animate-pulse" : ""
|
| 149 |
}`}
|
| 150 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
{defaultHTML !== html && (
|
| 152 |
<button
|
| 153 |
className="bg-white lg:hidden -translate-y-[calc(100%+8px)] absolute left-0 top-0 shadow-md text-gray-950 text-xs font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 hover:brightness-150 transition-all duration-100 cursor-pointer"
|
|
|
|
| 4 |
import { GrSend } from "react-icons/gr";
|
| 5 |
import classNames from "classnames";
|
| 6 |
import { toast } from "react-toastify";
|
| 7 |
+
import { useCopyToClipboard, useLocalStorage } from "react-use";
|
| 8 |
import { MdPreview } from "react-icons/md";
|
| 9 |
+
import { IoCopy } from "react-icons/io5";
|
| 10 |
|
| 11 |
import Login from "../login/login";
|
| 12 |
import { defaultHTML } from "./../../../utils/consts";
|
|
|
|
| 40 |
const [openProvider, setOpenProvider] = useState(false);
|
| 41 |
const [providerError, setProviderError] = useState("");
|
| 42 |
const [openProModal, setOpenProModal] = useState(false);
|
| 43 |
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
| 44 |
+
const [_, copyToClipboard] = useCopyToClipboard();
|
| 45 |
|
| 46 |
const audio = new Audio(SuccessSound);
|
| 47 |
audio.volume = 0.5;
|
|
|
|
| 151 |
isAiWorking ? "animate-pulse" : ""
|
| 152 |
}`}
|
| 153 |
>
|
| 154 |
+
{defaultHTML !== html && (
|
| 155 |
+
<p
|
| 156 |
+
className="text-2xl text-white/50 hover:text-white/80 -translate-y-[calc(100%+8px)] absolute top-0 right-0 cursor-pointer"
|
| 157 |
+
onClick={() => {
|
| 158 |
+
copyToClipboard(html);
|
| 159 |
+
toast.success("HTML copied to clipboard");
|
| 160 |
+
audio.play();
|
| 161 |
+
}}
|
| 162 |
+
>
|
| 163 |
+
<IoCopy />
|
| 164 |
+
</p>
|
| 165 |
+
)}
|
| 166 |
{defaultHTML !== html && (
|
| 167 |
<button
|
| 168 |
className="bg-white lg:hidden -translate-y-[calc(100%+8px)] absolute left-0 top-0 shadow-md text-gray-950 text-xs font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 hover:brightness-150 transition-all duration-100 cursor-pointer"
|