fix all theming
This commit is contained in:
parent
acc194dbd3
commit
c4adb08473
@ -8,6 +8,10 @@ const nextConfig = {
|
|||||||
protocol: "https",
|
protocol: "https",
|
||||||
hostname: "supabasekong-mco40gw4sc0gs4ks40w4c4g4.dev3vds1.link",
|
hostname: "supabasekong-mco40gw4sc0gs4ks40w4c4g4.dev3vds1.link",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
protocol: "https",
|
||||||
|
hostname: "minio-s3.dev3vds1.link",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
34
package-lock.json
generated
34
package-lock.json
generated
@ -20,11 +20,12 @@
|
|||||||
"@tanstack/react-query": "^5.64.1",
|
"@tanstack/react-query": "^5.64.1",
|
||||||
"@tanstack/react-query-devtools": "^5.64.1",
|
"@tanstack/react-query-devtools": "^5.64.1",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"embla-carousel-react": "^8.1.7",
|
"embla-carousel-react": "^8.1.7",
|
||||||
"framer-motion": "^11.3.21",
|
"framer-motion": "^11.3.21",
|
||||||
"lucide-react": "^0.417.0",
|
"lucide-react": "^0.417.0",
|
||||||
|
"motion": "^11.18.0",
|
||||||
"next": "14.2.7",
|
"next": "14.2.7",
|
||||||
"next-themes": "^0.3.0",
|
"next-themes": "^0.3.0",
|
||||||
"nuqs": "^2.3.1",
|
"nuqs": "^2.3.1",
|
||||||
@ -3512,9 +3513,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/framer-motion": {
|
"node_modules/framer-motion": {
|
||||||
"version": "11.17.0",
|
"version": "11.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.18.0.tgz",
|
||||||
"integrity": "sha512-uTNLH9JPMD3ad14WBt3KYRTR+If4tGPLgKTKTIIPaEBMkvazs6EkWNcmCh65qA/tyinOqIbQiuCorXX0qQsNoQ==",
|
"integrity": "sha512-Vmjl5Al7XqKHzDFnVqzi1H9hzn5w4eN/bdqXTymVpU2UuMQuz9w6UPdsL9dFBeH7loBlnu4qcEXME+nvbkcIOw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"motion-dom": "^11.16.4",
|
"motion-dom": "^11.16.4",
|
||||||
"motion-utils": "^11.16.0",
|
"motion-utils": "^11.16.0",
|
||||||
@ -5547,6 +5548,31 @@
|
|||||||
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
|
||||||
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
|
"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": {
|
"node_modules/motion-dom": {
|
||||||
"version": "11.16.4",
|
"version": "11.16.4",
|
||||||
"resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.16.4.tgz",
|
"resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.16.4.tgz",
|
||||||
|
@ -21,11 +21,12 @@
|
|||||||
"@tanstack/react-query": "^5.64.1",
|
"@tanstack/react-query": "^5.64.1",
|
||||||
"@tanstack/react-query-devtools": "^5.64.1",
|
"@tanstack/react-query-devtools": "^5.64.1",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"embla-carousel-react": "^8.1.7",
|
"embla-carousel-react": "^8.1.7",
|
||||||
"framer-motion": "^11.3.21",
|
"framer-motion": "^11.3.21",
|
||||||
"lucide-react": "^0.417.0",
|
"lucide-react": "^0.417.0",
|
||||||
|
"motion": "^11.18.0",
|
||||||
"next": "14.2.7",
|
"next": "14.2.7",
|
||||||
"next-themes": "^0.3.0",
|
"next-themes": "^0.3.0",
|
||||||
"nuqs": "^2.3.1",
|
"nuqs": "^2.3.1",
|
||||||
|
@ -6,7 +6,7 @@ import { z } from "zod";
|
|||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
|
|
||||||
import { Pencil } from "lucide-react";
|
import { Play } from "lucide-react";
|
||||||
|
|
||||||
import { formatDate } from "@/lib/utils";
|
import { formatDate } from "@/lib/utils";
|
||||||
|
|
||||||
@ -41,12 +41,21 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
|
|
||||||
import axios, { AxiosError } from "axios";
|
import axios, { AxiosError } from "axios";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
import { createClient } from "@/utils/supabase/client";
|
||||||
|
|
||||||
type AgentCardProps = { data: Tables<"agents"> };
|
type AgentCardProps = { data: Tables<"agents"> };
|
||||||
|
|
||||||
export default function AgentCard(props: AgentCardProps) {
|
export default function AgentCard(props: AgentCardProps) {
|
||||||
const { id, image_url, name, description, model_type, created_at } =
|
const {
|
||||||
props.data;
|
id,
|
||||||
|
image_url,
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
model_type,
|
||||||
|
created_at,
|
||||||
|
conversation,
|
||||||
|
last_conv,
|
||||||
|
} = props.data;
|
||||||
|
|
||||||
const [openDialogUpdate, setOpenDialogUpdate] = React.useState(false);
|
const [openDialogUpdate, setOpenDialogUpdate] = React.useState(false);
|
||||||
|
|
||||||
@ -72,6 +81,22 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
|
|
||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
mutationFn: async (values: z.infer<typeof formSchema>) => {
|
mutationFn: async (values: z.infer<typeof formSchema>) => {
|
||||||
|
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(
|
const url = encodeURI(
|
||||||
`https://ai-endpoint-one.dev3vds1.link/deepinfra-ai/${name}/${model_type}/${description}/${values.question}`
|
`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;
|
} = form;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="bg-background flex flex-col rounded-lg p-4 border hover:shadow-sm transition-shadow duration-200">
|
<li className="flex flex-col rounded-lg p-4 border border-accent-foreground hover:shadow-sm transition-shadow duration-200">
|
||||||
<figure className="overflow-hidden relative rounded-lg object-cover border mb-3 w-full h-[200px]">
|
<figure className="overflow-hidden relative rounded-lg object-cover border mb-3 w-full h-[200px]">
|
||||||
<Image
|
<Image
|
||||||
className="w-full object-cover"
|
className="w-full object-cover"
|
||||||
@ -142,36 +167,45 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
alt={name}
|
alt={name}
|
||||||
/>
|
/>
|
||||||
<div className="h-full w-full absolute top-0 left-0" />
|
<div className="h-full w-full absolute top-0 left-0" />
|
||||||
<Badge className="absolute bottom-3 left-3">{model_type}</Badge>
|
|
||||||
</figure>
|
</figure>
|
||||||
<p className="mb-2">
|
<div className="flex items-center justify-between">
|
||||||
<time dateTime={created_at} className="text-sm text-muted-foreground">
|
<Badge className="mb-2" variant={"secondary"}>
|
||||||
{formatDate(created_at)}
|
{conversation} chats
|
||||||
|
</Badge>
|
||||||
|
<p className="mb-2 text-primary">
|
||||||
|
<time dateTime={created_at} className="text-xs">
|
||||||
|
Last Active:{" "}
|
||||||
|
<span className="font-bold">
|
||||||
|
{last_conv ? formatDate(last_conv) : "-"}
|
||||||
|
</span>
|
||||||
</time>
|
</time>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
<h3 className="text-xl font-semibold mb-2 truncate">{name}</h3>
|
<h3 className="text-xl font-semibold mb-2 truncate">{name}</h3>
|
||||||
<p className="text-sm text-foreground line-clamp-2 mb-4">{description}</p>
|
<p className="text-sm text-foreground line-clamp-3 mb-4">{description}</p>
|
||||||
<div className="mt-auto grid">
|
<div className="mt-auto grid">
|
||||||
<Dialog
|
<Dialog
|
||||||
open={openDialogUpdate}
|
open={openDialogUpdate}
|
||||||
onOpenChange={(val) => {
|
onOpenChange={(val) => {
|
||||||
// form.reset();
|
form.reset();
|
||||||
|
mutation.reset();
|
||||||
setOpenDialogUpdate(val);
|
setOpenDialogUpdate(val);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
<Button size={"sm"} variant={"outline"}>
|
<Button size={"sm"} variant={"outline"}>
|
||||||
<Pencil className="h-4 w-4 mr-2" />
|
<Play className="h-4 w-4 mr-2" />
|
||||||
<span>Try it</span>
|
<span>Try it</span>
|
||||||
</Button>
|
</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
<DialogContent className="w-[90%] h-[90vh] max-w-xl rounded-md overflow-y-scroll">
|
<DialogContent className="w-[90%] max-h-[90vh] max-w-xl rounded-md overflow-y-scroll">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Try Agent</DialogTitle>
|
<DialogTitle>Try Agent</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
Try to ask a question to our agent
|
Try to ask a question to our agent
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
<div>
|
||||||
<figure className="overflow-hidden relative rounded-lg object-cover border mb-3 w-full h-[200px]">
|
<figure className="overflow-hidden relative rounded-lg object-cover border mb-3 w-full h-[200px]">
|
||||||
<Image
|
<Image
|
||||||
className="w-full object-cover"
|
className="w-full object-cover"
|
||||||
@ -180,9 +214,21 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
alt={name}
|
alt={name}
|
||||||
/>
|
/>
|
||||||
<div className="h-full w-full absolute top-0 left-0" />
|
<div className="h-full w-full absolute top-0 left-0" />
|
||||||
<Badge className="absolute bottom-3 left-3">{model_type}</Badge>
|
|
||||||
</figure>
|
</figure>
|
||||||
<ul className="text-sm space-y-3">
|
<div className="flex items-center justify-between mb-3">
|
||||||
|
<Badge className="mb-2" variant={"secondary"}>
|
||||||
|
{conversation} chats
|
||||||
|
</Badge>
|
||||||
|
<p className="mb-2 text-primary">
|
||||||
|
<time dateTime={created_at} className="text-xs">
|
||||||
|
Last Active:{" "}
|
||||||
|
<span className="font-bold">
|
||||||
|
{last_conv ? formatDate(last_conv) : "-"}
|
||||||
|
</span>
|
||||||
|
</time>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<ul className="text-sm space-y-3 mb-3">
|
||||||
<li>
|
<li>
|
||||||
<h3 className="font-bold">Name:</h3>
|
<h3 className="font-bold">Name:</h3>
|
||||||
<p className="text-gray-500">{name}</p>
|
<p className="text-gray-500">{name}</p>
|
||||||
@ -208,7 +254,8 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
rows={4}
|
rows={4}
|
||||||
placeholder="For answering daily questions."
|
placeholder="For answering daily questions."
|
||||||
className={clsx(
|
className={clsx(
|
||||||
errors.question && "focus-visible:ring-destructive"
|
errors.question &&
|
||||||
|
"focus-visible:ring-destructive"
|
||||||
)}
|
)}
|
||||||
{...field}
|
{...field}
|
||||||
/>
|
/>
|
||||||
@ -217,7 +264,6 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{mutation.isSuccess && (
|
{mutation.isSuccess && (
|
||||||
<>
|
<>
|
||||||
<h3 className="text-sm font-bold">Answer:</h3>
|
<h3 className="text-sm font-bold">Answer:</h3>
|
||||||
@ -226,7 +272,6 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<DialogFooter className="mt-4 flex justify-end space-x-2">
|
<DialogFooter className="mt-4 flex justify-end space-x-2">
|
||||||
<DialogClose asChild>
|
<DialogClose asChild>
|
||||||
<Button
|
<Button
|
||||||
@ -241,7 +286,11 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
</DialogClose>
|
</DialogClose>
|
||||||
<Button type="submit" disabled={mutation.isPending} size="sm">
|
<Button
|
||||||
|
type="submit"
|
||||||
|
disabled={mutation.isPending}
|
||||||
|
size="sm"
|
||||||
|
>
|
||||||
{mutation.isPending && (
|
{mutation.isPending && (
|
||||||
<Spinner className="mr-2 h-4 w-4 " />
|
<Spinner className="mr-2 h-4 w-4 " />
|
||||||
)}
|
)}
|
||||||
@ -250,6 +299,7 @@ export default function AgentCard(props: AgentCardProps) {
|
|||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,6 +19,7 @@ import { Button } from "@/components/ui/button";
|
|||||||
|
|
||||||
import AgentCardSkeleton from "./agent-card-skeleton";
|
import AgentCardSkeleton from "./agent-card-skeleton";
|
||||||
import AgentCard from "./agent-card";
|
import AgentCard from "./agent-card";
|
||||||
|
import { ChatFloatingButton } from "@/components/chat-floating-button";
|
||||||
|
|
||||||
const DATA_DISPLAY = 6;
|
const DATA_DISPLAY = 6;
|
||||||
|
|
||||||
@ -66,7 +67,8 @@ export function AgentList() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section className="pt-8 pb-10 min-h-[50vh] bg-white/50 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur-lg">
|
<ChatFloatingButton />
|
||||||
|
<section className="group pt-8 pb-10 min-h-[50vh] ">
|
||||||
<div className="layout">
|
<div className="layout">
|
||||||
<h1 className="mb-4 text-3xl font-bold text-foreground sm:text-4xl">
|
<h1 className="mb-4 text-3xl font-bold text-foreground sm:text-4xl">
|
||||||
Agents
|
Agents
|
||||||
@ -90,7 +92,7 @@ export function AgentList() {
|
|||||||
<Search className="absolute w-4 h-4 left-2 top-1/2 -translate-y-1/2 text-gray-300" />
|
<Search className="absolute w-4 h-4 left-2 top-1/2 -translate-y-1/2 text-gray-300" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul className="grid grid-cols-1 gap-8 mb-10 sm:grid-cols-2 lg:grid-cols-3">
|
<ul className="grid gap-8 mb-10 sm:grid-cols-2 lg:grid-cols-3">
|
||||||
{isLoading &&
|
{isLoading &&
|
||||||
[...Array(6)].map((_, idx) => (
|
[...Array(6)].map((_, idx) => (
|
||||||
<li key={idx}>
|
<li key={idx}>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { ChatFloatingButton } from "@/components/chat-floating-button";
|
||||||
import Blog from "@/components/sections/blog";
|
import Blog from "@/components/sections/blog";
|
||||||
import CTA from "@/components/sections/cta";
|
import CTA from "@/components/sections/cta";
|
||||||
import FAQ from "@/components/sections/faq";
|
import FAQ from "@/components/sections/faq";
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
--destructive: 0 84.2% 60.2%;
|
--destructive: 0 84.2% 60.2%;
|
||||||
--destructive-foreground: 210 40% 98%;
|
--destructive-foreground: 210 40% 98%;
|
||||||
--border: 214.3 31.8% 91.4%;
|
--border: 214.3 31.8% 91.4%;
|
||||||
--input: 214.3 31.8% 91.4%;
|
--input: 22 68% 91%;
|
||||||
--ring: 9 60% 32%;
|
--ring: 9 60% 32%;
|
||||||
--radius: 0.5rem;
|
--radius: 0.5rem;
|
||||||
--chart-1: 12 76% 61%;
|
--chart-1: 12 76% 61%;
|
||||||
@ -49,7 +49,7 @@
|
|||||||
--destructive: 0 62.8% 30.6%;
|
--destructive: 0 62.8% 30.6%;
|
||||||
--destructive-foreground: 0 85.7% 97.3%;
|
--destructive-foreground: 0 85.7% 97.3%;
|
||||||
--border: 240 3.7% 15.9%;
|
--border: 240 3.7% 15.9%;
|
||||||
--input: 240 3.7% 15.9%;
|
--input: 9 60% 32%;
|
||||||
--ring: 240 4.9% 83.9%;
|
--ring: 240 4.9% 83.9%;
|
||||||
--chart-1: 220 70% 50%;
|
--chart-1: 220 70% 50%;
|
||||||
--chart-2: 160 60% 45%;
|
--chart-2: 160 60% 45%;
|
||||||
@ -100,3 +100,10 @@
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.layout-2 {
|
||||||
|
max-width: 1100px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
@ -47,8 +47,8 @@ export default function RootLayout({
|
|||||||
enableSystem={false}
|
enableSystem={false}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
<ThemeToggle />
|
{/* <ThemeToggle /> */}
|
||||||
<TailwindIndicator />
|
{/* <TailwindIndicator /> */}
|
||||||
<Toaster richColors />
|
<Toaster richColors />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</NuqsAdapter>
|
</NuqsAdapter>
|
||||||
|
64
src/components/chat-floating-button.tsx
Normal file
64
src/components/chat-floating-button.tsx
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import * as motion from "motion/react-client";
|
||||||
|
import { AnimatePresence } from "motion/react";
|
||||||
|
|
||||||
|
import { MessageSquare, X } from "lucide-react";
|
||||||
|
|
||||||
|
import { ChatCard, Message } from "@/components/ui/chat-card";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
const CURRENT_USER = {
|
||||||
|
name: "You",
|
||||||
|
avatar: "/placeholder.png",
|
||||||
|
};
|
||||||
|
|
||||||
|
const INITIAL_MESSAGES: Message[] = [
|
||||||
|
{
|
||||||
|
content: "Hi! Got any questions? I'm here to help you.",
|
||||||
|
sender: {
|
||||||
|
name: "beactio.ai",
|
||||||
|
avatar: "/logo.png",
|
||||||
|
isOnline: true,
|
||||||
|
},
|
||||||
|
timestamp: "10:26 AM",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export function ChatFloatingButton() {
|
||||||
|
const [openAssistant, setOpenAssistant] = React.useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Button
|
||||||
|
variant={"default"}
|
||||||
|
size={"icon"}
|
||||||
|
className="z-30 fixed right-4 bottom-4 rounded-full h-14 w-14"
|
||||||
|
onClick={() => setOpenAssistant((old) => !old)}
|
||||||
|
>
|
||||||
|
{openAssistant ? <X /> : <MessageSquare />}
|
||||||
|
</Button>
|
||||||
|
<AnimatePresence>
|
||||||
|
{openAssistant && (
|
||||||
|
<motion.div
|
||||||
|
key={"chatbox"}
|
||||||
|
className="z-20 fixed right-4 bottom-20 "
|
||||||
|
initial={{ opacity: 0, y: 50 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
exit={{ opacity: 0, y: 50 }}
|
||||||
|
transition={{
|
||||||
|
duration: 0.2,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ChatCard
|
||||||
|
chatName={"beactio.ai"}
|
||||||
|
initialMessages={INITIAL_MESSAGES}
|
||||||
|
currentUser={CURRENT_USER}
|
||||||
|
className={"border border-zinc-200"}
|
||||||
|
/>
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
@ -1,3 +1,6 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { motion } from "framer-motion";
|
||||||
interface SectionProps {
|
interface SectionProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
@ -7,6 +10,8 @@ interface SectionProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ease = [0.16, 1, 0.3, 1];
|
||||||
|
|
||||||
export default function Section({
|
export default function Section({
|
||||||
id,
|
id,
|
||||||
title,
|
title,
|
||||||
@ -22,14 +27,31 @@ export default function Section({
|
|||||||
<div className="relative container mx-auto px-4 py-16 max-w-7xl">
|
<div className="relative container mx-auto px-4 py-16 max-w-7xl">
|
||||||
<div className="text-center space-y-4 pb-6 mx-auto">
|
<div className="text-center space-y-4 pb-6 mx-auto">
|
||||||
{title && (
|
{title && (
|
||||||
<h2 className="text-sm text-primary font-mono font-medium tracking-wider uppercase">
|
<motion.h2
|
||||||
|
initial={{ filter: "blur(10px)", opacity: 0, y: 50 }}
|
||||||
|
animate={{ filter: "blur(0px)", opacity: 1, y: 0 }}
|
||||||
|
transition={{
|
||||||
|
duration: 1,
|
||||||
|
ease,
|
||||||
|
}}
|
||||||
|
className="text-sm text-primary font-mono font-medium tracking-wider uppercase"
|
||||||
|
>
|
||||||
{title}
|
{title}
|
||||||
</h2>
|
</motion.h2>
|
||||||
)}
|
)}
|
||||||
{subtitle && (
|
{subtitle && (
|
||||||
<h3 className="mx-auto mt-4 max-w-xs text-3xl font-semibold sm:max-w-none sm:text-4xl md:text-5xl">
|
<motion.h3
|
||||||
|
initial={{ filter: "blur(10px)", opacity: 0, y: 50 }}
|
||||||
|
animate={{ filter: "blur(0px)", opacity: 1, y: 0 }}
|
||||||
|
transition={{
|
||||||
|
delay: 0.2,
|
||||||
|
duration: 1,
|
||||||
|
ease,
|
||||||
|
}}
|
||||||
|
className="mx-auto mt-4 max-w-xs text-3xl font-semibold sm:max-w-none sm:text-4xl md:text-5xl"
|
||||||
|
>
|
||||||
{subtitle}
|
{subtitle}
|
||||||
</h3>
|
</motion.h3>
|
||||||
)}
|
)}
|
||||||
{description && (
|
{description && (
|
||||||
<p className="mt-6 text-lg leading-8 text-slate-600 max-w-2xl mx-auto">
|
<p className="mt-6 text-lg leading-8 text-slate-600 max-w-2xl mx-auto">
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
import { Icons } from "@/components/icons";
|
|
||||||
import Section from "@/components/section";
|
|
||||||
import { buttonVariants } from "@/components/ui/button";
|
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
import { Rocket } from "lucide-react";
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
import { buttonVariants } from "@/components/ui/button";
|
||||||
|
import Section from "@/components/section";
|
||||||
|
|
||||||
export default function CtaSection() {
|
export default function CtaSection() {
|
||||||
return (
|
return (
|
||||||
<Section
|
<Section
|
||||||
id="cta"
|
id="cta"
|
||||||
title="Ready to get started?"
|
title="Ready to experience the future of autonomous AI?"
|
||||||
subtitle="Start your journey today."
|
subtitle="Join us and try our agentic AI into your operations."
|
||||||
className="bg-primary/10 rounded-xl py-16"
|
className="bg-primary/10 dark:bg-primary/70 rounded-xl py-16"
|
||||||
>
|
>
|
||||||
<div className="flex flex-col w-full sm:flex-row items-center justify-center space-y-4 sm:space-y-0 sm:space-x-4 pt-4">
|
<div className="flex flex-col w-full sm:flex-row items-center justify-center space-y-4 sm:space-y-0 sm:space-x-4 pt-4">
|
||||||
<Link
|
<Link
|
||||||
@ -20,7 +23,7 @@ export default function CtaSection() {
|
|||||||
"w-full sm:w-auto text-background flex gap-2"
|
"w-full sm:w-auto text-background flex gap-2"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icons.logo className="h-6 w-6" />
|
<Rocket className="h-6 w-6" />
|
||||||
Get started
|
Get started
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
import { Icons } from "@/components/icons";
|
|
||||||
import { siteConfig } from "@/lib/config";
|
|
||||||
import { ChevronRight } from "lucide-react";
|
|
||||||
import Image from "next/image";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
|
import { ChevronRight } from "lucide-react";
|
||||||
|
|
||||||
|
import { siteConfig } from "@/lib/config";
|
||||||
|
|
||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
return (
|
return (
|
||||||
<footer>
|
<footer>
|
||||||
<div className="max-w-6xl mx-auto py-16 sm:px-10 px-5 pb-0">
|
<div className="layout py-16 sm:px-10 px-5 pb-0">
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
title={siteConfig.name}
|
title={siteConfig.name}
|
||||||
@ -15,8 +16,8 @@ export default function Footer() {
|
|||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
src="/logo.png"
|
src="/logo.png"
|
||||||
height={40}
|
height={44}
|
||||||
width={40}
|
width={44}
|
||||||
alt="logo"
|
alt="logo"
|
||||||
className="rounded-md shadow"
|
className="rounded-md shadow"
|
||||||
/>
|
/>
|
||||||
|
@ -41,8 +41,8 @@ export default function Header() {
|
|||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
src="/logo.png"
|
src="/logo.png"
|
||||||
height={36}
|
height={44}
|
||||||
width={36}
|
width={44}
|
||||||
alt="logo"
|
alt="logo"
|
||||||
className="rounded-md shadow"
|
className="rounded-md shadow"
|
||||||
/>
|
/>
|
||||||
|
@ -1,24 +1,28 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import { Icons } from "@/components/icons";
|
import { BadgePlus, Compass } from "lucide-react";
|
||||||
import HeroVideoDialog from "@/components/magicui/hero-video";
|
|
||||||
import { buttonVariants } from "@/components/ui/button";
|
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import Link from "next/link";
|
|
||||||
import { Plus } from "lucide-react";
|
import { buttonVariants } from "@/components/ui/button";
|
||||||
|
import HeroVideoDialog from "@/components/magicui/hero-video";
|
||||||
|
|
||||||
const ease = [0.16, 1, 0.3, 1];
|
const ease = [0.16, 1, 0.3, 1];
|
||||||
|
|
||||||
function HeroPill() {
|
function HeroPill() {
|
||||||
return (
|
return (
|
||||||
<motion.a
|
<motion.div
|
||||||
href="/blog/introducing-acme-ai"
|
|
||||||
className="flex w-auto items-center space-x-2 rounded-full bg-primary/20 px-2 py-1 ring-1 ring-accent whitespace-pre"
|
|
||||||
initial={{ opacity: 0, y: -20 }}
|
initial={{ opacity: 0, y: -20 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
transition={{ duration: 0.8, ease }}
|
transition={{ duration: 0.8, ease }}
|
||||||
|
>
|
||||||
|
<Link
|
||||||
|
href={process.env.NEXT_PUBLIC_DASHBOARD_URL!}
|
||||||
|
className="flex w-auto items-center space-x-2 rounded-full bg-primary/20 px-2 py-1 ring-1 ring-accent whitespace-pre"
|
||||||
>
|
>
|
||||||
<div className="w-fit rounded-full bg-accent px-2 py-0.5 text-center text-xs font-medium text-primary sm:text-sm">
|
<div className="w-fit rounded-full bg-accent px-2 py-0.5 text-center text-xs font-medium text-primary sm:text-sm">
|
||||||
📣 Announcement
|
📣 Announcement
|
||||||
@ -39,7 +43,8 @@ function HeroPill() {
|
|||||||
fill="hsl(var(--primary))"
|
fill="hsl(var(--primary))"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</motion.a>
|
</Link>
|
||||||
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +61,7 @@ function HeroTitles() {
|
|||||||
staggerChildren: 0.2,
|
staggerChildren: 0.2,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{["Deploy", "AI", "Agents", "with", "Ease"].map((text, index) => (
|
{["AI", "Meets", "Simplicity"].map((text, index) => (
|
||||||
<motion.span
|
<motion.span
|
||||||
key={index}
|
key={index}
|
||||||
className="inline-block px-1 md:px-2 text-balance font-semibold"
|
className="inline-block px-1 md:px-2 text-balance font-semibold"
|
||||||
@ -82,8 +87,8 @@ function HeroTitles() {
|
|||||||
ease,
|
ease,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Create, manage, and scale your AI personalities effortlessly. Bring your
|
Transform the future of artificial intelligence with truly autonomous
|
||||||
AI model with only single click.
|
systems that think, plan, and act independently.
|
||||||
</motion.p>
|
</motion.p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -105,7 +110,7 @@ function HeroCTA() {
|
|||||||
"w-full sm:w-auto text-background flex gap-2"
|
"w-full sm:w-auto text-background flex gap-2"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Plus className="h-6 w-6" />
|
<BadgePlus className="h-6 w-6" />
|
||||||
Create new Agent
|
Create new Agent
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
@ -115,7 +120,7 @@ function HeroCTA() {
|
|||||||
"w-full sm:w-auto flex gap-2"
|
"w-full sm:w-auto flex gap-2"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icons.logo className="h-6 w-6" />
|
<Compass className="h-6 w-6" />
|
||||||
Explore Agents
|
Explore Agents
|
||||||
</Link>
|
</Link>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
@ -1,34 +1,57 @@
|
|||||||
|
import { BrainCog, Puzzle, Speech } from "lucide-react";
|
||||||
|
|
||||||
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
|
import NumberTicker from "@/components/ui/number-ticker";
|
||||||
import BlurFade from "@/components/magicui/blur-fade";
|
import BlurFade from "@/components/magicui/blur-fade";
|
||||||
import Section from "@/components/section";
|
import Section from "@/components/section";
|
||||||
import { Card, CardContent } from "@/components/ui/card";
|
|
||||||
import { Brain, Shield, Zap } from "lucide-react";
|
|
||||||
|
|
||||||
const problems = [
|
const problems = [
|
||||||
{
|
{
|
||||||
title: "Best Agent",
|
title: "Dynamic Goal Formation",
|
||||||
description: "Choose the ideal agent bot tailored to your specific needs.",
|
description:
|
||||||
icon: Brain,
|
"Unlike traditional AI systems that rely on predefined objectives, our agents can formulate and prioritize their own goals based on their understanding of the broader context and desired outcomes.",
|
||||||
|
icon: BrainCog,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Fast Response",
|
title: "Contextual Understanding",
|
||||||
description:
|
description:
|
||||||
"Experience our quick-thinking chatbot, ready to answer all your questions.",
|
"Our agents don't operate in a vacuum. They grasp the nuances of their environment, understanding not just what's happening, but why it matters and how it affects their objectives.",
|
||||||
icon: Zap,
|
icon: Puzzle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Engage More",
|
title: "Human Values at Core",
|
||||||
description:
|
description:
|
||||||
"Transform your experience with a chatbot built for intelligent engagement.",
|
"We've built robust ethical considerations directly into our agents' decision-making processes, ensuring they operate not just effectively, but responsibly and in alignment with human values.",
|
||||||
icon: Shield,
|
icon: Speech,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const stats = [
|
||||||
|
{
|
||||||
|
title: "Decision Accuracy",
|
||||||
|
number: 99,
|
||||||
|
unit: "%",
|
||||||
|
description:
|
||||||
|
"Success rate in autonomous decision-making across all deployments",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Processing Speed",
|
||||||
|
number: 65,
|
||||||
|
unit: "x",
|
||||||
|
description: "Faster than human operators in complex decision scenarios",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Daily Decisions",
|
||||||
|
number: 100,
|
||||||
|
unit: "+",
|
||||||
|
description: "Autonomous conversations made by our systems every day",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function Component() {
|
export default function Component() {
|
||||||
return (
|
return (
|
||||||
<Section
|
<>
|
||||||
title="Why Us?"
|
<Section title="Be Different" subtitle="Technology That Sets Us Apart">
|
||||||
subtitle="Explore and try to create our various interactive agents."
|
|
||||||
>
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 mt-12">
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 mt-12">
|
||||||
{problems.map((problem, index) => (
|
{problems.map((problem, index) => (
|
||||||
<BlurFade key={index} delay={0.2 + index * 0.2} inView>
|
<BlurFade key={index} delay={0.2 + index * 0.2} inView>
|
||||||
@ -45,5 +68,32 @@ export default function Component() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
|
<Section title="Success stories" subtitle="Celebrate Our Success Stories">
|
||||||
|
<BlurFade>
|
||||||
|
<div className="border-primary/10 bg-accent-foreground py-8 rounded-lg shadow grid grid-cols-1 md:grid-cols-3 gap-8 mt-12">
|
||||||
|
{stats.map((stat, index) => (
|
||||||
|
<Card
|
||||||
|
key={index}
|
||||||
|
className="bg-transparent border-none shadow-none"
|
||||||
|
>
|
||||||
|
<CardContent className="p-6 space-y-4 flex flex-col items-center text-center">
|
||||||
|
<div className="flex items-center text-4xl font-bold text-primary">
|
||||||
|
<div className="w-32 h-32 bg-primary/10 rounded-full flex items-center justify-center">
|
||||||
|
<NumberTicker
|
||||||
|
value={stat.number}
|
||||||
|
className="text-primary"
|
||||||
|
/>
|
||||||
|
<span>{stat.unit}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h3 className="text-xl font-bold">{stat.title}</h3>
|
||||||
|
<p className="text-muted-foreground">{stat.description}</p>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</BlurFade>
|
||||||
|
</Section>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ const badgeVariants = cva(
|
|||||||
default:
|
default:
|
||||||
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
||||||
secondary:
|
secondary:
|
||||||
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
"border-transparent bg-accent-foreground text-primary",
|
||||||
destructive:
|
destructive:
|
||||||
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
||||||
outline: "text-foreground",
|
outline: "text-foreground",
|
||||||
|
@ -13,7 +13,7 @@ const buttonVariants = cva(
|
|||||||
destructive:
|
destructive:
|
||||||
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
||||||
outline:
|
outline:
|
||||||
"border border-input bg-background hover:bg-accent hover:text-primary",
|
"border border-accent-foreground bg-background text-primary hover:bg-accent hover:text-primary",
|
||||||
secondary:
|
secondary:
|
||||||
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||||
|
244
src/components/ui/chat-card.tsx
Normal file
244
src/components/ui/chat-card.tsx
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
|
import { useMutation } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
import axios, { AxiosError } from "axios";
|
||||||
|
|
||||||
|
import { toast } from "sonner";
|
||||||
|
|
||||||
|
import clsx from "clsx";
|
||||||
|
|
||||||
|
import { Send } from "lucide-react";
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import Spinner from "../spinner";
|
||||||
|
|
||||||
|
export interface Message {
|
||||||
|
content: string;
|
||||||
|
sender: {
|
||||||
|
name: string;
|
||||||
|
avatar: string;
|
||||||
|
isOnline: boolean;
|
||||||
|
isCurrentUser?: boolean;
|
||||||
|
};
|
||||||
|
timestamp: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ChatCardProps {
|
||||||
|
chatName?: string;
|
||||||
|
initialMessages?: Message[];
|
||||||
|
currentUser?: {
|
||||||
|
name: string;
|
||||||
|
avatar: string;
|
||||||
|
};
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ChatCard({
|
||||||
|
chatName,
|
||||||
|
initialMessages = [],
|
||||||
|
currentUser = {
|
||||||
|
name: "You",
|
||||||
|
avatar:
|
||||||
|
"https://ferf1mheo22r9ira.public.blob.vercel-storage.com/avatar-03-n0x8HFv8EUetf9z6ht0wScJKoTHqf8.png",
|
||||||
|
},
|
||||||
|
className,
|
||||||
|
}: ChatCardProps) {
|
||||||
|
const [messages, setMessages] = React.useState<Message[]>(initialMessages);
|
||||||
|
const [inputValue, setInputValue] = React.useState("");
|
||||||
|
|
||||||
|
const mutation = useMutation({
|
||||||
|
mutationFn: async (userInput: string) => {
|
||||||
|
const url = encodeURI(
|
||||||
|
`https://ai-endpoint-one.dev3vds1.link/chatbot/beactio/${userInput}`
|
||||||
|
);
|
||||||
|
const json = await axios.get(url);
|
||||||
|
|
||||||
|
return json.data;
|
||||||
|
},
|
||||||
|
onSuccess: (data: { response: string; system_prompt: string }) => {
|
||||||
|
const newMessage: Message = {
|
||||||
|
content: data.response,
|
||||||
|
sender: {
|
||||||
|
name: "beactio.ai",
|
||||||
|
avatar: "/logo.png",
|
||||||
|
isOnline: true,
|
||||||
|
},
|
||||||
|
timestamp: new Date().toLocaleTimeString([], {
|
||||||
|
hour: "numeric",
|
||||||
|
minute: "2-digit",
|
||||||
|
hour12: true,
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
setMessages((old) => [...old, newMessage]);
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
if (error instanceof AxiosError) {
|
||||||
|
if (error.response) {
|
||||||
|
const errResponse = error.response.data;
|
||||||
|
toast.error("There is something wrong");
|
||||||
|
console.log({ errResponse });
|
||||||
|
} else if (error.request) {
|
||||||
|
toast.error("No response from the server", {
|
||||||
|
description: "Failed to fetch the data, server returns null.",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
toast.error("Failed to set up the request", {
|
||||||
|
description: "There is something wrong when setting up the request",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleSendMessage = () => {
|
||||||
|
if (!inputValue.trim()) return;
|
||||||
|
|
||||||
|
const newMessage: Message = {
|
||||||
|
content: inputValue,
|
||||||
|
sender: {
|
||||||
|
name: currentUser.name,
|
||||||
|
avatar: currentUser.avatar,
|
||||||
|
isOnline: true,
|
||||||
|
isCurrentUser: true,
|
||||||
|
},
|
||||||
|
timestamp: new Date().toLocaleTimeString([], {
|
||||||
|
hour: "numeric",
|
||||||
|
minute: "2-digit",
|
||||||
|
hour12: true,
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
setMessages((prev) => [...prev, newMessage]);
|
||||||
|
setInputValue("");
|
||||||
|
|
||||||
|
mutation.mutate(inputValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
"w-[360px] mx-auto rounded-2xl overflow-hidden",
|
||||||
|
"bg-white text-zinc-900 border border-zinc-200",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="flex flex-col h-[480px]">
|
||||||
|
{/* Header */}
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
"px-4 py-3 flex items-center justify-between border-b border-zinc-200"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<div className="relative">
|
||||||
|
<div className="relative w-10 h-10 rounded-full flex items-center justify-center overflow-hidden">
|
||||||
|
<Image
|
||||||
|
src="/logo.png"
|
||||||
|
className="object-cover"
|
||||||
|
fill={true}
|
||||||
|
alt="logo"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full bg-emerald-500 ring-2 ring-white"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 className={cn("font-medium text-zinc-900")}>{chatName}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Messages */}
|
||||||
|
<div className="flex-1 overflow-y-auto p-4 space-y-4">
|
||||||
|
{messages.map((message, idx) => (
|
||||||
|
<div key={idx} className={"flex items-start gap-3"}>
|
||||||
|
{!message.sender.isCurrentUser && (
|
||||||
|
<Image
|
||||||
|
src={message.sender.avatar}
|
||||||
|
alt={message.sender.name}
|
||||||
|
width={36}
|
||||||
|
height={36}
|
||||||
|
className="rounded-full"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={clsx(
|
||||||
|
message.sender.isCurrentUser ? "ml-auto" : "mr-auto"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="text-sm flex items-center gap-2 mb-1">
|
||||||
|
<span className={cn("font-medium text-zinc-900")}>
|
||||||
|
{message.sender.name}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={clsx(
|
||||||
|
"py-2 px-3 rounded-md",
|
||||||
|
message.sender.isCurrentUser
|
||||||
|
? "bg-accent-foreground"
|
||||||
|
: "bg-accent"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
className={cn(
|
||||||
|
"text-sm break-words",
|
||||||
|
message.sender.isCurrentUser
|
||||||
|
? "text-primary"
|
||||||
|
: "text-zinc-700"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{message.content}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Input */}
|
||||||
|
<div className={cn("p-4 bg-white")}>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<div className="relative flex-1">
|
||||||
|
<Input
|
||||||
|
disabled={mutation.isPending}
|
||||||
|
type="text"
|
||||||
|
value={inputValue}
|
||||||
|
onChange={(e) => setInputValue(e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter" && !e.shiftKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
handleSendMessage();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
placeholder="Write a message..."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
disabled={mutation.isPending}
|
||||||
|
onClick={handleSendMessage}
|
||||||
|
size={"icon"}
|
||||||
|
>
|
||||||
|
{mutation.isPending ? (
|
||||||
|
<Spinner className="w-5 h-5" />
|
||||||
|
) : (
|
||||||
|
<Send className="w-5 h-5" />
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
58
src/components/ui/number-ticker.tsx
Normal file
58
src/components/ui/number-ticker.tsx
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect, useRef } from "react";
|
||||||
|
import { useInView, useMotionValue, useSpring } from "motion/react";
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
export default function NumberTicker({
|
||||||
|
value,
|
||||||
|
direction = "up",
|
||||||
|
delay = 0,
|
||||||
|
className,
|
||||||
|
decimalPlaces = 0,
|
||||||
|
}: {
|
||||||
|
value: number;
|
||||||
|
direction?: "up" | "down";
|
||||||
|
className?: string;
|
||||||
|
delay?: number; // delay in s
|
||||||
|
decimalPlaces?: number;
|
||||||
|
}) {
|
||||||
|
const ref = useRef<HTMLSpanElement>(null);
|
||||||
|
const motionValue = useMotionValue(direction === "down" ? value : 0);
|
||||||
|
const springValue = useSpring(motionValue, {
|
||||||
|
damping: 60,
|
||||||
|
stiffness: 100,
|
||||||
|
});
|
||||||
|
const isInView = useInView(ref, { once: true, margin: "0px" });
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
isInView &&
|
||||||
|
setTimeout(() => {
|
||||||
|
motionValue.set(direction === "down" ? 0 : value);
|
||||||
|
}, delay * 1000);
|
||||||
|
}, [motionValue, isInView, delay, value, direction]);
|
||||||
|
|
||||||
|
useEffect(
|
||||||
|
() =>
|
||||||
|
springValue.on("change", (latest) => {
|
||||||
|
if (ref.current) {
|
||||||
|
ref.current.textContent = Intl.NumberFormat("en-US", {
|
||||||
|
minimumFractionDigits: decimalPlaces,
|
||||||
|
maximumFractionDigits: decimalPlaces,
|
||||||
|
}).format(Number(latest.toFixed(decimalPlaces)));
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
[springValue, decimalPlaces],
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span
|
||||||
|
className={cn(
|
||||||
|
"inline-block tabular-nums tracking-wider text-black dark:text-white",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
ref={ref}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
@ -197,15 +197,15 @@ export const siteConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
footer: [
|
footer: [
|
||||||
{
|
// {
|
||||||
title: "Product",
|
// title: "Product",
|
||||||
links: [
|
// links: [
|
||||||
{ href: "#", text: "Features", icon: null },
|
// { href: "#", text: "Features", icon: null },
|
||||||
// { href: "#", text: "Pricing", icon: null },
|
// // { href: "#", text: "Pricing", icon: null },
|
||||||
{ href: "#", text: "Documentation", icon: null },
|
// { href: "#", text: "Documentation", icon: null },
|
||||||
{ href: "#", text: "API", icon: null },
|
// { href: "#", text: "API", icon: null },
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// title: "Company",
|
// title: "Company",
|
||||||
// links: [
|
// links: [
|
||||||
@ -230,7 +230,7 @@ export const siteConfig = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
href: "#",
|
href: "#",
|
||||||
text: "Twitter",
|
text: "X",
|
||||||
icon: <FaTwitter />,
|
icon: <FaTwitter />,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
@ -59,31 +59,31 @@ export function constructMetadata({
|
|||||||
|
|
||||||
export function formatDate(date: string) {
|
export function formatDate(date: string) {
|
||||||
let currentDate = new Date().getTime();
|
let currentDate = new Date().getTime();
|
||||||
|
|
||||||
if (!date.includes("T")) {
|
if (!date.includes("T")) {
|
||||||
date = `${date}T00:00:00`;
|
date = `${date}T00:00:00`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetDate = new Date(date).getTime();
|
let targetDate = new Date(date).getTime();
|
||||||
let timeDifference = Math.abs(currentDate - targetDate);
|
let timeDifference = currentDate - targetDate;
|
||||||
let daysAgo = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
|
|
||||||
|
|
||||||
let fullDate = new Date(date).toLocaleString("en-us", {
|
const minutesAgo = Math.floor(timeDifference / (1000 * 60));
|
||||||
month: "long",
|
const hoursAgo = Math.floor(timeDifference / (1000 * 60 * 60));
|
||||||
day: "numeric",
|
const daysAgo = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
|
||||||
year: "numeric",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (daysAgo < 1) {
|
|
||||||
return "Today";
|
|
||||||
} else if (daysAgo < 7) {
|
|
||||||
return `${fullDate} (${daysAgo}d ago)`;
|
|
||||||
} else if (daysAgo < 30) {
|
|
||||||
const weeksAgo = Math.floor(daysAgo / 7);
|
|
||||||
return `${fullDate} (${weeksAgo}w ago)`;
|
|
||||||
} else if (daysAgo < 365) {
|
|
||||||
const monthsAgo = Math.floor(daysAgo / 30);
|
const monthsAgo = Math.floor(daysAgo / 30);
|
||||||
return `${fullDate} (${monthsAgo}mo ago)`;
|
|
||||||
} else {
|
|
||||||
const yearsAgo = Math.floor(daysAgo / 365);
|
const yearsAgo = Math.floor(daysAgo / 365);
|
||||||
return `${fullDate} (${yearsAgo}y ago)`;
|
|
||||||
|
if (minutesAgo < 1) {
|
||||||
|
return "Just now";
|
||||||
|
} else if (minutesAgo < 60) {
|
||||||
|
return `${minutesAgo} minute${minutesAgo > 1 ? "s" : ""} ago`;
|
||||||
|
} else if (hoursAgo < 24) {
|
||||||
|
return `${hoursAgo} hour${hoursAgo > 1 ? "s" : ""} ago`;
|
||||||
|
} else if (daysAgo < 30) {
|
||||||
|
return `${daysAgo} day${daysAgo > 1 ? "s" : ""} ago`;
|
||||||
|
} else if (daysAgo < 365) {
|
||||||
|
return `${monthsAgo} month${monthsAgo > 1 ? "s" : ""} ago`;
|
||||||
|
} else {
|
||||||
|
return `${yearsAgo} year${yearsAgo > 1 ? "s" : ""} ago`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ export default function ReactQueryProvider({
|
|||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
{children}
|
{children}
|
||||||
<ReactQueryDevtools initialIsOpen={false} />
|
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,98 +4,104 @@ export type Json =
|
|||||||
| boolean
|
| boolean
|
||||||
| null
|
| null
|
||||||
| { [key: string]: Json | undefined }
|
| { [key: string]: Json | undefined }
|
||||||
| Json[]
|
| Json[];
|
||||||
|
|
||||||
export type Database = {
|
export type Database = {
|
||||||
graphql_public: {
|
graphql_public: {
|
||||||
Tables: {
|
Tables: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
Views: {
|
Views: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
Functions: {
|
Functions: {
|
||||||
graphql: {
|
graphql: {
|
||||||
Args: {
|
Args: {
|
||||||
operationName?: string
|
operationName?: string;
|
||||||
query?: string
|
query?: string;
|
||||||
variables?: Json
|
variables?: Json;
|
||||||
extensions?: Json
|
extensions?: Json;
|
||||||
}
|
};
|
||||||
Returns: Json
|
Returns: Json;
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
Enums: {
|
Enums: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
CompositeTypes: {
|
CompositeTypes: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
pgbouncer: {
|
pgbouncer: {
|
||||||
Tables: {
|
Tables: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
Views: {
|
Views: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
Functions: {
|
Functions: {
|
||||||
get_auth: {
|
get_auth: {
|
||||||
Args: {
|
Args: {
|
||||||
p_usename: string
|
p_usename: string;
|
||||||
}
|
};
|
||||||
Returns: {
|
Returns: {
|
||||||
username: string
|
username: string;
|
||||||
password: string
|
password: string;
|
||||||
}[]
|
}[];
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
Enums: {
|
Enums: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
CompositeTypes: {
|
CompositeTypes: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
public: {
|
public: {
|
||||||
Tables: {
|
Tables: {
|
||||||
agents: {
|
agents: {
|
||||||
Row: {
|
Row: {
|
||||||
created_at: string
|
conversation: number;
|
||||||
description: string
|
created_at: string;
|
||||||
id: number
|
description: string;
|
||||||
image_url: string | null
|
id: number;
|
||||||
model_type: Database["public"]["Enums"]["modelType"]
|
image_url: string | null;
|
||||||
name: string
|
last_conv: string | null;
|
||||||
user_id: string | null
|
model_type: Database["public"]["Enums"]["modelType"];
|
||||||
}
|
name: string;
|
||||||
|
user_id: string | null;
|
||||||
|
};
|
||||||
Insert: {
|
Insert: {
|
||||||
created_at?: string
|
conversation?: number;
|
||||||
description: string
|
created_at?: string;
|
||||||
id?: number
|
description: string;
|
||||||
image_url?: string | null
|
id?: number;
|
||||||
model_type: Database["public"]["Enums"]["modelType"]
|
image_url?: string | null;
|
||||||
name: string
|
last_conv?: string | null;
|
||||||
user_id?: string | null
|
model_type: Database["public"]["Enums"]["modelType"];
|
||||||
}
|
name: string;
|
||||||
|
user_id?: string | null;
|
||||||
|
};
|
||||||
Update: {
|
Update: {
|
||||||
created_at?: string
|
conversation?: number;
|
||||||
description?: string
|
created_at?: string;
|
||||||
id?: number
|
description?: string;
|
||||||
image_url?: string | null
|
id?: number;
|
||||||
model_type?: Database["public"]["Enums"]["modelType"]
|
image_url?: string | null;
|
||||||
name?: string
|
last_conv?: string | null;
|
||||||
user_id?: string | null
|
model_type?: Database["public"]["Enums"]["modelType"];
|
||||||
}
|
name?: string;
|
||||||
Relationships: []
|
user_id?: string | null;
|
||||||
}
|
};
|
||||||
}
|
Relationships: [];
|
||||||
|
};
|
||||||
|
};
|
||||||
Views: {
|
Views: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
Functions: {
|
Functions: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
Enums: {
|
Enums: {
|
||||||
modelType:
|
modelType:
|
||||||
| "roleplay"
|
| "roleplay"
|
||||||
@ -110,325 +116,326 @@ export type Database = {
|
|||||||
| "health"
|
| "health"
|
||||||
| "trivia"
|
| "trivia"
|
||||||
| "academia"
|
| "academia"
|
||||||
}
|
| "general";
|
||||||
|
};
|
||||||
CompositeTypes: {
|
CompositeTypes: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
storage: {
|
storage: {
|
||||||
Tables: {
|
Tables: {
|
||||||
buckets: {
|
buckets: {
|
||||||
Row: {
|
Row: {
|
||||||
allowed_mime_types: string[] | null
|
allowed_mime_types: string[] | null;
|
||||||
avif_autodetection: boolean | null
|
avif_autodetection: boolean | null;
|
||||||
created_at: string | null
|
created_at: string | null;
|
||||||
file_size_limit: number | null
|
file_size_limit: number | null;
|
||||||
id: string
|
id: string;
|
||||||
name: string
|
name: string;
|
||||||
owner: string | null
|
owner: string | null;
|
||||||
owner_id: string | null
|
owner_id: string | null;
|
||||||
public: boolean | null
|
public: boolean | null;
|
||||||
updated_at: string | null
|
updated_at: string | null;
|
||||||
}
|
};
|
||||||
Insert: {
|
Insert: {
|
||||||
allowed_mime_types?: string[] | null
|
allowed_mime_types?: string[] | null;
|
||||||
avif_autodetection?: boolean | null
|
avif_autodetection?: boolean | null;
|
||||||
created_at?: string | null
|
created_at?: string | null;
|
||||||
file_size_limit?: number | null
|
file_size_limit?: number | null;
|
||||||
id: string
|
id: string;
|
||||||
name: string
|
name: string;
|
||||||
owner?: string | null
|
owner?: string | null;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
public?: boolean | null
|
public?: boolean | null;
|
||||||
updated_at?: string | null
|
updated_at?: string | null;
|
||||||
}
|
};
|
||||||
Update: {
|
Update: {
|
||||||
allowed_mime_types?: string[] | null
|
allowed_mime_types?: string[] | null;
|
||||||
avif_autodetection?: boolean | null
|
avif_autodetection?: boolean | null;
|
||||||
created_at?: string | null
|
created_at?: string | null;
|
||||||
file_size_limit?: number | null
|
file_size_limit?: number | null;
|
||||||
id?: string
|
id?: string;
|
||||||
name?: string
|
name?: string;
|
||||||
owner?: string | null
|
owner?: string | null;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
public?: boolean | null
|
public?: boolean | null;
|
||||||
updated_at?: string | null
|
updated_at?: string | null;
|
||||||
}
|
};
|
||||||
Relationships: []
|
Relationships: [];
|
||||||
}
|
};
|
||||||
migrations: {
|
migrations: {
|
||||||
Row: {
|
Row: {
|
||||||
executed_at: string | null
|
executed_at: string | null;
|
||||||
hash: string
|
hash: string;
|
||||||
id: number
|
id: number;
|
||||||
name: string
|
name: string;
|
||||||
}
|
};
|
||||||
Insert: {
|
Insert: {
|
||||||
executed_at?: string | null
|
executed_at?: string | null;
|
||||||
hash: string
|
hash: string;
|
||||||
id: number
|
id: number;
|
||||||
name: string
|
name: string;
|
||||||
}
|
};
|
||||||
Update: {
|
Update: {
|
||||||
executed_at?: string | null
|
executed_at?: string | null;
|
||||||
hash?: string
|
hash?: string;
|
||||||
id?: number
|
id?: number;
|
||||||
name?: string
|
name?: string;
|
||||||
}
|
};
|
||||||
Relationships: []
|
Relationships: [];
|
||||||
}
|
};
|
||||||
objects: {
|
objects: {
|
||||||
Row: {
|
Row: {
|
||||||
bucket_id: string | null
|
bucket_id: string | null;
|
||||||
created_at: string | null
|
created_at: string | null;
|
||||||
id: string
|
id: string;
|
||||||
last_accessed_at: string | null
|
last_accessed_at: string | null;
|
||||||
metadata: Json | null
|
metadata: Json | null;
|
||||||
name: string | null
|
name: string | null;
|
||||||
owner: string | null
|
owner: string | null;
|
||||||
owner_id: string | null
|
owner_id: string | null;
|
||||||
path_tokens: string[] | null
|
path_tokens: string[] | null;
|
||||||
updated_at: string | null
|
updated_at: string | null;
|
||||||
user_metadata: Json | null
|
user_metadata: Json | null;
|
||||||
version: string | null
|
version: string | null;
|
||||||
}
|
};
|
||||||
Insert: {
|
Insert: {
|
||||||
bucket_id?: string | null
|
bucket_id?: string | null;
|
||||||
created_at?: string | null
|
created_at?: string | null;
|
||||||
id?: string
|
id?: string;
|
||||||
last_accessed_at?: string | null
|
last_accessed_at?: string | null;
|
||||||
metadata?: Json | null
|
metadata?: Json | null;
|
||||||
name?: string | null
|
name?: string | null;
|
||||||
owner?: string | null
|
owner?: string | null;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
path_tokens?: string[] | null
|
path_tokens?: string[] | null;
|
||||||
updated_at?: string | null
|
updated_at?: string | null;
|
||||||
user_metadata?: Json | null
|
user_metadata?: Json | null;
|
||||||
version?: string | null
|
version?: string | null;
|
||||||
}
|
};
|
||||||
Update: {
|
Update: {
|
||||||
bucket_id?: string | null
|
bucket_id?: string | null;
|
||||||
created_at?: string | null
|
created_at?: string | null;
|
||||||
id?: string
|
id?: string;
|
||||||
last_accessed_at?: string | null
|
last_accessed_at?: string | null;
|
||||||
metadata?: Json | null
|
metadata?: Json | null;
|
||||||
name?: string | null
|
name?: string | null;
|
||||||
owner?: string | null
|
owner?: string | null;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
path_tokens?: string[] | null
|
path_tokens?: string[] | null;
|
||||||
updated_at?: string | null
|
updated_at?: string | null;
|
||||||
user_metadata?: Json | null
|
user_metadata?: Json | null;
|
||||||
version?: string | null
|
version?: string | null;
|
||||||
}
|
};
|
||||||
Relationships: [
|
Relationships: [
|
||||||
{
|
{
|
||||||
foreignKeyName: "objects_bucketId_fkey"
|
foreignKeyName: "objects_bucketId_fkey";
|
||||||
columns: ["bucket_id"]
|
columns: ["bucket_id"];
|
||||||
referencedRelation: "buckets"
|
referencedRelation: "buckets";
|
||||||
referencedColumns: ["id"]
|
referencedColumns: ["id"];
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
s3_multipart_uploads: {
|
s3_multipart_uploads: {
|
||||||
Row: {
|
Row: {
|
||||||
bucket_id: string
|
bucket_id: string;
|
||||||
created_at: string
|
created_at: string;
|
||||||
id: string
|
id: string;
|
||||||
in_progress_size: number
|
in_progress_size: number;
|
||||||
key: string
|
key: string;
|
||||||
owner_id: string | null
|
owner_id: string | null;
|
||||||
upload_signature: string
|
upload_signature: string;
|
||||||
user_metadata: Json | null
|
user_metadata: Json | null;
|
||||||
version: string
|
version: string;
|
||||||
}
|
};
|
||||||
Insert: {
|
Insert: {
|
||||||
bucket_id: string
|
bucket_id: string;
|
||||||
created_at?: string
|
created_at?: string;
|
||||||
id: string
|
id: string;
|
||||||
in_progress_size?: number
|
in_progress_size?: number;
|
||||||
key: string
|
key: string;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
upload_signature: string
|
upload_signature: string;
|
||||||
user_metadata?: Json | null
|
user_metadata?: Json | null;
|
||||||
version: string
|
version: string;
|
||||||
}
|
};
|
||||||
Update: {
|
Update: {
|
||||||
bucket_id?: string
|
bucket_id?: string;
|
||||||
created_at?: string
|
created_at?: string;
|
||||||
id?: string
|
id?: string;
|
||||||
in_progress_size?: number
|
in_progress_size?: number;
|
||||||
key?: string
|
key?: string;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
upload_signature?: string
|
upload_signature?: string;
|
||||||
user_metadata?: Json | null
|
user_metadata?: Json | null;
|
||||||
version?: string
|
version?: string;
|
||||||
}
|
};
|
||||||
Relationships: [
|
Relationships: [
|
||||||
{
|
{
|
||||||
foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
|
foreignKeyName: "s3_multipart_uploads_bucket_id_fkey";
|
||||||
columns: ["bucket_id"]
|
columns: ["bucket_id"];
|
||||||
referencedRelation: "buckets"
|
referencedRelation: "buckets";
|
||||||
referencedColumns: ["id"]
|
referencedColumns: ["id"];
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
s3_multipart_uploads_parts: {
|
s3_multipart_uploads_parts: {
|
||||||
Row: {
|
Row: {
|
||||||
bucket_id: string
|
bucket_id: string;
|
||||||
created_at: string
|
created_at: string;
|
||||||
etag: string
|
etag: string;
|
||||||
id: string
|
id: string;
|
||||||
key: string
|
key: string;
|
||||||
owner_id: string | null
|
owner_id: string | null;
|
||||||
part_number: number
|
part_number: number;
|
||||||
size: number
|
size: number;
|
||||||
upload_id: string
|
upload_id: string;
|
||||||
version: string
|
version: string;
|
||||||
}
|
};
|
||||||
Insert: {
|
Insert: {
|
||||||
bucket_id: string
|
bucket_id: string;
|
||||||
created_at?: string
|
created_at?: string;
|
||||||
etag: string
|
etag: string;
|
||||||
id?: string
|
id?: string;
|
||||||
key: string
|
key: string;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
part_number: number
|
part_number: number;
|
||||||
size?: number
|
size?: number;
|
||||||
upload_id: string
|
upload_id: string;
|
||||||
version: string
|
version: string;
|
||||||
}
|
};
|
||||||
Update: {
|
Update: {
|
||||||
bucket_id?: string
|
bucket_id?: string;
|
||||||
created_at?: string
|
created_at?: string;
|
||||||
etag?: string
|
etag?: string;
|
||||||
id?: string
|
id?: string;
|
||||||
key?: string
|
key?: string;
|
||||||
owner_id?: string | null
|
owner_id?: string | null;
|
||||||
part_number?: number
|
part_number?: number;
|
||||||
size?: number
|
size?: number;
|
||||||
upload_id?: string
|
upload_id?: string;
|
||||||
version?: string
|
version?: string;
|
||||||
}
|
};
|
||||||
Relationships: [
|
Relationships: [
|
||||||
{
|
{
|
||||||
foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
|
foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey";
|
||||||
columns: ["bucket_id"]
|
columns: ["bucket_id"];
|
||||||
referencedRelation: "buckets"
|
referencedRelation: "buckets";
|
||||||
referencedColumns: ["id"]
|
referencedColumns: ["id"];
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
|
foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey";
|
||||||
columns: ["upload_id"]
|
columns: ["upload_id"];
|
||||||
referencedRelation: "s3_multipart_uploads"
|
referencedRelation: "s3_multipart_uploads";
|
||||||
referencedColumns: ["id"]
|
referencedColumns: ["id"];
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
Views: {
|
Views: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
Functions: {
|
Functions: {
|
||||||
can_insert_object: {
|
can_insert_object: {
|
||||||
Args: {
|
Args: {
|
||||||
bucketid: string
|
bucketid: string;
|
||||||
name: string
|
name: string;
|
||||||
owner: string
|
owner: string;
|
||||||
metadata: Json
|
metadata: Json;
|
||||||
}
|
};
|
||||||
Returns: undefined
|
Returns: undefined;
|
||||||
}
|
};
|
||||||
extension: {
|
extension: {
|
||||||
Args: {
|
Args: {
|
||||||
name: string
|
name: string;
|
||||||
}
|
};
|
||||||
Returns: string
|
Returns: string;
|
||||||
}
|
};
|
||||||
filename: {
|
filename: {
|
||||||
Args: {
|
Args: {
|
||||||
name: string
|
name: string;
|
||||||
}
|
};
|
||||||
Returns: string
|
Returns: string;
|
||||||
}
|
};
|
||||||
foldername: {
|
foldername: {
|
||||||
Args: {
|
Args: {
|
||||||
name: string
|
name: string;
|
||||||
}
|
};
|
||||||
Returns: string[]
|
Returns: string[];
|
||||||
}
|
};
|
||||||
get_size_by_bucket: {
|
get_size_by_bucket: {
|
||||||
Args: Record<PropertyKey, never>
|
Args: Record<PropertyKey, never>;
|
||||||
Returns: {
|
Returns: {
|
||||||
size: number
|
size: number;
|
||||||
bucket_id: string
|
bucket_id: string;
|
||||||
}[]
|
}[];
|
||||||
}
|
};
|
||||||
list_multipart_uploads_with_delimiter: {
|
list_multipart_uploads_with_delimiter: {
|
||||||
Args: {
|
Args: {
|
||||||
bucket_id: string
|
bucket_id: string;
|
||||||
prefix_param: string
|
prefix_param: string;
|
||||||
delimiter_param: string
|
delimiter_param: string;
|
||||||
max_keys?: number
|
max_keys?: number;
|
||||||
next_key_token?: string
|
next_key_token?: string;
|
||||||
next_upload_token?: string
|
next_upload_token?: string;
|
||||||
}
|
};
|
||||||
Returns: {
|
Returns: {
|
||||||
key: string
|
key: string;
|
||||||
id: string
|
id: string;
|
||||||
created_at: string
|
created_at: string;
|
||||||
}[]
|
}[];
|
||||||
}
|
};
|
||||||
list_objects_with_delimiter: {
|
list_objects_with_delimiter: {
|
||||||
Args: {
|
Args: {
|
||||||
bucket_id: string
|
bucket_id: string;
|
||||||
prefix_param: string
|
prefix_param: string;
|
||||||
delimiter_param: string
|
delimiter_param: string;
|
||||||
max_keys?: number
|
max_keys?: number;
|
||||||
start_after?: string
|
start_after?: string;
|
||||||
next_token?: string
|
next_token?: string;
|
||||||
}
|
};
|
||||||
Returns: {
|
Returns: {
|
||||||
name: string
|
name: string;
|
||||||
id: string
|
id: string;
|
||||||
metadata: Json
|
metadata: Json;
|
||||||
updated_at: string
|
updated_at: string;
|
||||||
}[]
|
}[];
|
||||||
}
|
};
|
||||||
operation: {
|
operation: {
|
||||||
Args: Record<PropertyKey, never>
|
Args: Record<PropertyKey, never>;
|
||||||
Returns: string
|
Returns: string;
|
||||||
}
|
};
|
||||||
search: {
|
search: {
|
||||||
Args: {
|
Args: {
|
||||||
prefix: string
|
prefix: string;
|
||||||
bucketname: string
|
bucketname: string;
|
||||||
limits?: number
|
limits?: number;
|
||||||
levels?: number
|
levels?: number;
|
||||||
offsets?: number
|
offsets?: number;
|
||||||
search?: string
|
search?: string;
|
||||||
sortcolumn?: string
|
sortcolumn?: string;
|
||||||
sortorder?: string
|
sortorder?: string;
|
||||||
}
|
};
|
||||||
Returns: {
|
Returns: {
|
||||||
name: string
|
name: string;
|
||||||
id: string
|
id: string;
|
||||||
updated_at: string
|
updated_at: string;
|
||||||
created_at: string
|
created_at: string;
|
||||||
last_accessed_at: string
|
last_accessed_at: string;
|
||||||
metadata: Json
|
metadata: Json;
|
||||||
}[]
|
}[];
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
Enums: {
|
Enums: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
CompositeTypes: {
|
CompositeTypes: {
|
||||||
[_ in never]: never
|
[_ in never]: never;
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
type PublicSchema = Database[Extract<keyof Database, "public">]
|
type PublicSchema = Database[Extract<keyof Database, "public">];
|
||||||
|
|
||||||
export type Tables<
|
export type Tables<
|
||||||
PublicTableNameOrOptions extends
|
PublicTableNameOrOptions extends
|
||||||
@ -437,11 +444,11 @@ export type Tables<
|
|||||||
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
||||||
? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
||||||
Database[PublicTableNameOrOptions["schema"]]["Views"])
|
Database[PublicTableNameOrOptions["schema"]]["Views"])
|
||||||
: never = never,
|
: never = never
|
||||||
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
||||||
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
||||||
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
||||||
Row: infer R
|
Row: infer R;
|
||||||
}
|
}
|
||||||
? R
|
? R
|
||||||
: never
|
: never
|
||||||
@ -449,11 +456,11 @@ export type Tables<
|
|||||||
PublicSchema["Views"])
|
PublicSchema["Views"])
|
||||||
? (PublicSchema["Tables"] &
|
? (PublicSchema["Tables"] &
|
||||||
PublicSchema["Views"])[PublicTableNameOrOptions] extends {
|
PublicSchema["Views"])[PublicTableNameOrOptions] extends {
|
||||||
Row: infer R
|
Row: infer R;
|
||||||
}
|
}
|
||||||
? R
|
? R
|
||||||
: never
|
: never
|
||||||
: never
|
: never;
|
||||||
|
|
||||||
export type TablesInsert<
|
export type TablesInsert<
|
||||||
PublicTableNameOrOptions extends
|
PublicTableNameOrOptions extends
|
||||||
@ -461,20 +468,20 @@ export type TablesInsert<
|
|||||||
| { schema: keyof Database },
|
| { schema: keyof Database },
|
||||||
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
||||||
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
||||||
: never = never,
|
: never = never
|
||||||
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
||||||
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
||||||
Insert: infer I
|
Insert: infer I;
|
||||||
}
|
}
|
||||||
? I
|
? I
|
||||||
: never
|
: never
|
||||||
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
||||||
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
||||||
Insert: infer I
|
Insert: infer I;
|
||||||
}
|
}
|
||||||
? I
|
? I
|
||||||
: never
|
: never
|
||||||
: never
|
: never;
|
||||||
|
|
||||||
export type TablesUpdate<
|
export type TablesUpdate<
|
||||||
PublicTableNameOrOptions extends
|
PublicTableNameOrOptions extends
|
||||||
@ -482,20 +489,20 @@ export type TablesUpdate<
|
|||||||
| { schema: keyof Database },
|
| { schema: keyof Database },
|
||||||
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
||||||
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
||||||
: never = never,
|
: never = never
|
||||||
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
||||||
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
||||||
Update: infer U
|
Update: infer U;
|
||||||
}
|
}
|
||||||
? U
|
? U
|
||||||
: never
|
: never
|
||||||
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
||||||
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
||||||
Update: infer U
|
Update: infer U;
|
||||||
}
|
}
|
||||||
? U
|
? U
|
||||||
: never
|
: never
|
||||||
: never
|
: never;
|
||||||
|
|
||||||
export type Enums<
|
export type Enums<
|
||||||
PublicEnumNameOrOptions extends
|
PublicEnumNameOrOptions extends
|
||||||
@ -503,9 +510,9 @@ export type Enums<
|
|||||||
| { schema: keyof Database },
|
| { schema: keyof Database },
|
||||||
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
|
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
|
||||||
? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
|
? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
|
||||||
: never = never,
|
: never = never
|
||||||
> = PublicEnumNameOrOptions extends { schema: keyof Database }
|
> = PublicEnumNameOrOptions extends { schema: keyof Database }
|
||||||
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
|
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
|
||||||
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
|
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
|
||||||
? PublicSchema["Enums"][PublicEnumNameOrOptions]
|
? PublicSchema["Enums"][PublicEnumNameOrOptions]
|
||||||
: never
|
: never;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user