From c4adb084736fc0f61da7b3fc12f6c800a34f82bc Mon Sep 17 00:00:00 2001 From: ErkiKadhafi Date: Thu, 16 Jan 2025 08:51:30 +0700 Subject: [PATCH] fix all theming --- next.config.mjs | 4 + package-lock.json | 34 +- package.json | 3 +- .../(main)/explore/_components/agent-card.tsx | 216 ++++-- .../(main)/explore/_components/agent-list.tsx | 6 +- src/app/(main)/page.tsx | 1 + src/app/globals.css | 11 +- src/app/layout.tsx | 4 +- src/components/chat-floating-button.tsx | 64 ++ src/components/section.tsx | 30 +- src/components/sections/cta.tsx | 19 +- src/components/sections/footer.tsx | 15 +- src/components/sections/header.tsx | 4 +- src/components/sections/hero.tsx | 69 +- src/components/sections/problem.tsx | 112 ++- src/components/ui/badge.tsx | 2 +- src/components/ui/button.tsx | 2 +- src/components/ui/chat-card.tsx | 244 ++++++ src/components/ui/number-ticker.tsx | 58 ++ src/lib/config.tsx | 20 +- src/lib/utils.ts | 34 +- src/providers/react-query-provider.tsx | 2 +- src/utils/supabase/database.types.ts | 715 +++++++++--------- 23 files changed, 1107 insertions(+), 562 deletions(-) create mode 100644 src/components/chat-floating-button.tsx create mode 100644 src/components/ui/chat-card.tsx create mode 100644 src/components/ui/number-ticker.tsx diff --git a/next.config.mjs b/next.config.mjs index c5a09b6..e5217dd 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -8,6 +8,10 @@ const nextConfig = { protocol: "https", hostname: "supabasekong-mco40gw4sc0gs4ks40w4c4g4.dev3vds1.link", }, + { + protocol: "https", + hostname: "minio-s3.dev3vds1.link", + }, ], }, }; diff --git a/package-lock.json b/package-lock.json index ea665c2..05b0836 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,11 +20,12 @@ "@tanstack/react-query": "^5.64.1", "@tanstack/react-query-devtools": "^5.64.1", "axios": "^1.7.9", - "class-variance-authority": "^0.7.0", + "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "embla-carousel-react": "^8.1.7", "framer-motion": "^11.3.21", "lucide-react": "^0.417.0", + "motion": "^11.18.0", "next": "14.2.7", "next-themes": "^0.3.0", "nuqs": "^2.3.1", @@ -3512,9 +3513,9 @@ } }, "node_modules/framer-motion": { - "version": "11.17.0", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.17.0.tgz", - "integrity": "sha512-uTNLH9JPMD3ad14WBt3KYRTR+If4tGPLgKTKTIIPaEBMkvazs6EkWNcmCh65qA/tyinOqIbQiuCorXX0qQsNoQ==", + "version": "11.18.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.18.0.tgz", + "integrity": "sha512-Vmjl5Al7XqKHzDFnVqzi1H9hzn5w4eN/bdqXTymVpU2UuMQuz9w6UPdsL9dFBeH7loBlnu4qcEXME+nvbkcIOw==", "dependencies": { "motion-dom": "^11.16.4", "motion-utils": "^11.16.0", @@ -5547,6 +5548,31 @@ "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" }, + "node_modules/motion": { + "version": "11.18.0", + "resolved": "https://registry.npmjs.org/motion/-/motion-11.18.0.tgz", + "integrity": "sha512-uJ4zNXh/4K9C5wftxHKlXLHC0Rc9dHSHPyO1P6T9XE2bTn2z8C2lOZX/M8vAmFp0gtJTJ3aYkv44lTtJSfv6+A==", + "dependencies": { + "framer-motion": "^11.18.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/motion-dom": { "version": "11.16.4", "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.16.4.tgz", diff --git a/package.json b/package.json index c80160c..6a14d6d 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,12 @@ "@tanstack/react-query": "^5.64.1", "@tanstack/react-query-devtools": "^5.64.1", "axios": "^1.7.9", - "class-variance-authority": "^0.7.0", + "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "embla-carousel-react": "^8.1.7", "framer-motion": "^11.3.21", "lucide-react": "^0.417.0", + "motion": "^11.18.0", "next": "14.2.7", "next-themes": "^0.3.0", "nuqs": "^2.3.1", diff --git a/src/app/(main)/explore/_components/agent-card.tsx b/src/app/(main)/explore/_components/agent-card.tsx index ecb0733..83d382e 100644 --- a/src/app/(main)/explore/_components/agent-card.tsx +++ b/src/app/(main)/explore/_components/agent-card.tsx @@ -6,7 +6,7 @@ import { z } from "zod"; import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; -import { Pencil } from "lucide-react"; +import { Play } from "lucide-react"; import { formatDate } from "@/lib/utils"; @@ -41,12 +41,21 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import axios, { AxiosError } from "axios"; import { toast } from "sonner"; +import { createClient } from "@/utils/supabase/client"; type AgentCardProps = { data: Tables<"agents"> }; export default function AgentCard(props: AgentCardProps) { - const { id, image_url, name, description, model_type, created_at } = - props.data; + const { + id, + image_url, + name, + description, + model_type, + created_at, + conversation, + last_conv, + } = props.data; const [openDialogUpdate, setOpenDialogUpdate] = React.useState(false); @@ -72,6 +81,22 @@ export default function AgentCard(props: AgentCardProps) { const mutation = useMutation({ mutationFn: async (values: z.infer) => { + const supabase = createClient(); + + const { data: existingAgent } = await supabase + .from("agents") + .select("*") + .eq("id", id); + + const { data, error } = await supabase + .from("agents") + .update({ + conversation: existingAgent ? existingAgent[0].conversation + 1 : 0, + last_conv: new Date().toISOString(), + }) + .eq("id", id) + .select(); + const url = encodeURI( `https://ai-endpoint-one.dev3vds1.link/deepinfra-ai/${name}/${model_type}/${description}/${values.question}` ); @@ -133,7 +158,7 @@ export default function AgentCard(props: AgentCardProps) { } = form; return ( -
  • +
  • {name}
    - {model_type}
    -

    - -

    +
    + + {conversation} chats + +

    + +

    +

    {name}

    -

    {description}

    +

    {description}

    { - // form.reset(); + form.reset(); + mutation.reset(); setOpenDialogUpdate(val); }} > - + Try Agent Try to ask a question to our agent -
    - {name} -
    - {model_type} -
    -
      -
    • -

      Name:

      -

      {name}

      -
    • -
    • -

      Description:

      -

      {description}

      -
    • -
    -
    - - ( - - Question: - -