-
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.
- Loading branch information
1 parent
d7de400
commit b078391
Showing
5 changed files
with
53 additions
and
128 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,128 +1,31 @@ | ||
import { Cat } from "@/app/lib/definitions"; | ||
import Paragraph from "../../Paragraph"; | ||
import { catCaracteristics } from "@/app/lib/data"; | ||
import { Icons } from "@/app/ui/icons"; | ||
|
||
const CatCaracteristics = ({ breed }: { breed: Cat }) => ( | ||
<> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Temperament: </strong> {breed.temperament} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Origin: </strong> | ||
{breed.origin} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Life Span: </strong> {breed.life_span} years | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Adaptability: </strong> | ||
{breed.adaptability} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Affection Level: </strong> | ||
{breed.affection_level} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Child Friendly: </strong> | ||
{breed.child_friendly} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Grooming: </strong> | ||
{breed.grooming} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Intelligence: </strong> | ||
{breed.intelligence} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Health issues: </strong> | ||
{breed.health_issues} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Social needs: </strong> | ||
{breed.social_needs} | ||
</> | ||
} | ||
/> | ||
</div> | ||
<div className="mt-8"> | ||
<Paragraph | ||
kind="p" | ||
content={ | ||
<> | ||
<strong>Stranger friendly: </strong> | ||
{breed.stranger_friendly} | ||
</> | ||
} | ||
/> | ||
</div> | ||
</> | ||
); | ||
const CatCaracteristics = ({ breed }: { breed: Cat }) => { | ||
const stars = Array(5).fill(0); | ||
|
||
return ( | ||
<> | ||
{catCaracteristics.map((caracteristic) => ( | ||
<div className="mt-8" key={caracteristic.name}> | ||
<div className="flex"> | ||
<strong className="mr-2">{caracteristic.name}: </strong> | ||
{caracteristic.rating === false && breed[caracteristic.data]} | ||
{caracteristic.rating === true && | ||
stars.map((_, index) => ( | ||
<div key={index} className="self-center md:ml-5"> | ||
<div | ||
className={`h-[12px] w-[60px] rounded-2xl ${breed[caracteristic.data] > index ? "bg-cioccolato" : "bg-alto"}`} | ||
></div> | ||
</div> | ||
))} | ||
{caracteristic.name === "Life Span" && " years"} | ||
</div> | ||
</div> | ||
))} | ||
</> | ||
); | ||
}; | ||
|
||
export default CatCaracteristics; |
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