-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/Glider6014/kanapka-ai into dev
- Loading branch information
Showing
15 changed files
with
119 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,7 @@ | |
MONGODB_URI= | ||
|
||
# OpenAI API key | ||
OPENAI_API_KEY= | ||
OPENAI_API_KEY= | ||
|
||
# NextAuth.js config | ||
NEXTAUTH_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
"use client"; | ||
import { Navbar } from "@/components/Navbar"; | ||
import SearchPanel from "@/components/SearchPanel"; | ||
import { RecipesList } from "@/components/RecipesList"; | ||
import { useState } from "react"; | ||
import { RecipeType } from "@/models/Recipe"; | ||
import ListIngredientsAndListRecipesSection from "@/components/sections/ListIngredientsAndListRecipesSection"; | ||
import { getServerSession } from "next-auth"; | ||
import { redirect } from "next/navigation"; | ||
import authOptions from "@/lib/nextauth"; | ||
|
||
export default async function Home() { | ||
const session = await getServerSession(authOptions); | ||
|
||
if (!session) { | ||
redirect("/user/signin"); | ||
} | ||
|
||
export default function Home() { | ||
const [recipes, setRecipes] = useState<RecipeType[]>([]); | ||
return ( | ||
<> | ||
<div className="container mx-auto p-4"> | ||
<Navbar /> | ||
<div className="flex flex-col md:flex-row gap-4"> | ||
<SearchPanel setRecipes={setRecipes} /> | ||
<div className="w-full md:w-3/5 mt-4 md:mt-0"> | ||
<RecipesList recipes={recipes} /> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
<div className="container mx-auto p-4"> | ||
<Navbar /> | ||
<ListIngredientsAndListRecipesSection /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
components/sections/ListIngredientsAndListRecipesSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"use client"; | ||
import SearchPanel from "@/components/SearchPanel"; | ||
import { RecipesList } from "@/components/RecipesList"; | ||
import { RecipeType } from "@/models/Recipe"; | ||
import { useState } from "react"; | ||
|
||
export default function ListIngredientsAndListRecipesSection() { | ||
const [recipes, setRecipes] = useState<RecipeType[]>([]); | ||
|
||
return ( | ||
<div className="flex flex-col md:flex-row gap-4"> | ||
<SearchPanel setRecipes={setRecipes} /> | ||
<div className="w-full md:w-3/5 mt-4 md:mt-0"> | ||
<RecipesList recipes={recipes} /> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.