initial commit
Browse files
app/_components/generation/index.tsx
CHANGED
|
@@ -20,7 +20,6 @@ export const Generation = () => {
|
|
| 20 |
style: "",
|
| 21 |
});
|
| 22 |
|
| 23 |
-
const [step, setStep] = useState<number>(0);
|
| 24 |
const [loading, setLoading] = useState<boolean>(false);
|
| 25 |
const [result, setResult] = useState<number | undefined>(undefined);
|
| 26 |
|
|
@@ -41,7 +40,7 @@ export const Generation = () => {
|
|
| 41 |
<h3 className="max-w-4xl text-3xl text-[#aaaaaa] font-semibold mb-12 text-center mx-auto">
|
| 42 |
Start your <span className="text-white">generation</span> here.
|
| 43 |
</h3>
|
| 44 |
-
<Steps
|
| 45 |
<div className="grid grid-cols-3 gap-20">
|
| 46 |
<Brand form={form} setForm={setForm} />
|
| 47 |
<Description form={form} setForm={setForm} />
|
|
|
|
| 20 |
style: "",
|
| 21 |
});
|
| 22 |
|
|
|
|
| 23 |
const [loading, setLoading] = useState<boolean>(false);
|
| 24 |
const [result, setResult] = useState<number | undefined>(undefined);
|
| 25 |
|
|
|
|
| 40 |
<h3 className="max-w-4xl text-3xl text-[#aaaaaa] font-semibold mb-12 text-center mx-auto">
|
| 41 |
Start your <span className="text-white">generation</span> here.
|
| 42 |
</h3>
|
| 43 |
+
<Steps form={form} />
|
| 44 |
<div className="grid grid-cols-3 gap-20">
|
| 45 |
<Brand form={form} setForm={setForm} />
|
| 46 |
<Description form={form} setForm={setForm} />
|
app/_components/generation/step/list.tsx
CHANGED
|
@@ -30,7 +30,7 @@ const STEPS = [
|
|
| 30 |
},
|
| 31 |
];
|
| 32 |
|
| 33 |
-
export const Steps = ({
|
| 34 |
return (
|
| 35 |
<div className="w-full flex items-center justify-center gap-2 mb-12">
|
| 36 |
{STEPS.map((s, i) => (
|
|
|
|
| 30 |
},
|
| 31 |
];
|
| 32 |
|
| 33 |
+
export const Steps = ({ form }: { form: Form }) => {
|
| 34 |
return (
|
| 35 |
<div className="w-full flex items-center justify-center gap-2 mb-12">
|
| 36 |
{STEPS.map((s, i) => (
|
app/api/logo/route.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
-
import { NextRequest } from "next/server";
|
| 2 |
import prisma from "@/_utils/prisma";
|
| 3 |
|
| 4 |
-
export async function GET(
|
| 5 |
const images = await prisma.logo.findMany({
|
| 6 |
select: {
|
| 7 |
id: true,
|
|
|
|
|
|
|
| 1 |
import prisma from "@/_utils/prisma";
|
| 2 |
|
| 3 |
+
export async function GET() {
|
| 4 |
const images = await prisma.logo.findMany({
|
| 5 |
select: {
|
| 6 |
id: true,
|
app/page.tsx
CHANGED
|
@@ -3,15 +3,10 @@ import { Generation } from "./_components/generation";
|
|
| 3 |
import { HeroHeader } from "./_components/hero-header";
|
| 4 |
|
| 5 |
async function getLogos() {
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
return logos;
|
| 11 |
-
} catch (error: any) {
|
| 12 |
-
console.error("Error fetching logos: ", error.message);
|
| 13 |
-
return [];
|
| 14 |
-
}
|
| 15 |
}
|
| 16 |
export const revalidate = 0;
|
| 17 |
|
|
|
|
| 3 |
import { HeroHeader } from "./_components/hero-header";
|
| 4 |
|
| 5 |
async function getLogos() {
|
| 6 |
+
const logos = await fetch(process.env.API_URL + "/api/logo")
|
| 7 |
+
.then((res) => res.json())
|
| 8 |
+
.then((data) => data);
|
| 9 |
+
return logos;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
}
|
| 11 |
export const revalidate = 0;
|
| 12 |
|