Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added front/public/images/embalse-generico.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 22 additions & 5 deletions front/src/app/embalse-provincia/[provincia]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Link from "next/link";
import { PROVINCIAS } from "@/core/constants";
import { Card } from "@/common/components/card.component";

interface Props {
params: Promise<{ provincia: string }>;
Expand All @@ -12,13 +13,29 @@ export default async function EmbalseProvinciaListadoPage({ params }: Props) {
(province) => province.id === provincia,
)?.name;

const reservoirs = [
{ id: "ullibarri-gamboa", name: "Ullibarri-Gamboa" },
{ id: "zadorra", name: "Zadorra" },
{ id: "urrúnaga", name: "Urrunaga" },
{ id: "maroño", name: "Maroño" },
{ id: "albina", name: "Albina" },
{ id: "santa-engracia", name: "Santa Engracia" },
];

return (
<div className="flex flex-col gap-8">
<Card>
<h2>Embalses de {nombreProvincia}</h2>

<Link href="/embalse/casasola" className="link-accessible">
Embalse de Casasola
</Link>
</div>
{reservoirs.map(({ id, name }) => (
<Link key={id} href={`/embalse/${id}`} className="link-accessible">
{name}
</Link>
))}
<img
className="mt-4 w-full rounded-xl sm:w-1/2 lg:w-1/3"
src="/images/embalse-generico.jpg"
alt="Mapa de embalses"
/>
</Card>
);
}
5 changes: 3 additions & 2 deletions front/src/app/embalse-provincia/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Link from "next/link";
import { PROVINCIAS } from "@/core/constants";
import { Card } from "@/common/components/card.component";

export default function EmbalsesProvinciaPage() {
return (
<div className="bg-base-100 flex flex-col gap-8 rounded-2xl p-4">
<Card>
<h2>Embalses por provincias</h2>
<div className="flex flex-col gap-4">
{PROVINCIAS.map(({ id, name }) => (
Expand All @@ -16,6 +17,6 @@ export default function EmbalsesProvinciaPage() {
</Link>
))}
</div>
</div>
</Card>
);
}
14 changes: 14 additions & 0 deletions front/src/common/components/card.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";

interface Props {
children?: React.ReactNode;
}

export const Card: React.FC<Props> = (props: Props) => {
const { children } = props;
return (
<div className="bg-base-100 flex flex-col gap-6 rounded-2xl p-4">
{children}
</div>
);
};
1 change: 1 addition & 0 deletions front/src/common/models/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./lookup.model";
export * from "./reservoir.model";