feat: Add all sidebar links to homepage
This commit is contained in:
parent
b0f4c449ba
commit
267e82ff04
1 changed files with 31 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { getAllLines } from "@/db";
|
||||
import { getAllDays, getAllLines } from "@/db";
|
||||
|
||||
interface HomePageProps {
|
||||
searchParams: Promise<{ message?: string }>;
|
||||
|
|
@ -7,6 +7,7 @@ interface HomePageProps {
|
|||
|
||||
export default async function Home({ searchParams }: HomePageProps) {
|
||||
const lines = await getAllLines();
|
||||
const days = await getAllDays();
|
||||
|
||||
const message = (await searchParams).message;
|
||||
console.log("Message from searchParams:", message);
|
||||
|
|
@ -17,11 +18,37 @@ export default async function Home({ searchParams }: HomePageProps) {
|
|||
{message && (
|
||||
<Alert variant="default">
|
||||
<AlertTitle>Refetch all data - Response</AlertTitle>
|
||||
<AlertDescription>
|
||||
{message}
|
||||
</AlertDescription>
|
||||
<AlertDescription>{message}</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
<section className="w-full">
|
||||
<ul className="list-disc pl-5">
|
||||
<li className="mb-2">
|
||||
<a href="/favorites" className="text-blue-600 hover:underline">
|
||||
Oblíbené
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section className="w-full">
|
||||
<h1 className="text-3xl font-bold mb-4">Dny</h1>
|
||||
<ul className="list-disc pl-5">
|
||||
{days.map((day) => (
|
||||
<li key={day} className="mb-2">
|
||||
<a
|
||||
href={`/day/${day}`}
|
||||
className="text-blue-600 hover:underline"
|
||||
>
|
||||
{new Date(day).toLocaleDateString("cs-CZ", {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "numeric",
|
||||
})}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
<section className="w-full">
|
||||
<h1 className="text-3xl font-bold mb-4">Linie</h1>
|
||||
<ul className="list-disc pl-5">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue