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
11 changes: 9 additions & 2 deletions front/src/common/components/card.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ import React from "react";

interface Props {
children?: React.ReactNode;
className?: string;
}

export const Card: React.FC<Props> = (props: Props) => {
const { children } = props;
const { children, className } = props;
return (
<div className="bg-base-100 m-8 flex flex-col gap-6 rounded-2xl p-4">
<div
className={
className
? className
: "bg-base-100 m-8 flex flex-col gap-6 rounded-2xl p-4"
}
>
{children}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ import Link from "next/link";

export const EmbalseProvinciaList: React.FC = () => {
return (
<Card>
<h2>Embalses por provincias</h2>
<div className="flex flex-col gap-4">
{PROVINCIAS.map(({ id, name }) => (
<Link
key={id}
href={`/embalse-provincia/${id}`}
className="link-accessible"
>
{name}
</Link>
))}
<Card className="mx-auto w-full pt-6 pr-4 pb-6 pl-4 md:max-w-[900px] md:p-8">
<div className="bg-base-100 rounded-2xl p-6">
<h2>Embalses por provincias</h2>
<div className="grid grid-cols-1 gap-4 p-6 sm:grid-cols-2 md:grid-cols-3">
{PROVINCIAS.map(({ id, name }) => (
<Link
key={id}
href={`/embalse-provincia/${id}`}
className="link-accessible"
>
{name}
</Link>
))}
</div>
</div>
</Card>
);
Expand Down