diff --git a/src/assets/images/landscapes/ThomasGainsborough/TheBlueBoy.jpg b/src/assets/images/landscapes/ThomasGainsborough/TheBlueBoy.jpg index 910265b..3ff819d 100644 Binary files a/src/assets/images/landscapes/ThomasGainsborough/TheBlueBoy.jpg and b/src/assets/images/landscapes/ThomasGainsborough/TheBlueBoy.jpg differ diff --git a/src/pages/ArtDescription.jsx b/src/pages/ArtDescription.jsx index 72b3cf6..4aeb382 100644 --- a/src/pages/ArtDescription.jsx +++ b/src/pages/ArtDescription.jsx @@ -9,19 +9,110 @@ import { Tab, } from '@nextui-org/react'; +const getArtItemById = (id) => { + for (const listKey in allLists) { + if (Object.prototype.hasOwnProperty.call(allLists, listKey)) { + const item = allLists[listKey].find((item) => item.id.toString() === id); + if (item) return item; + } + } + return null; +}; + +const FlagImage = ({ countryCode }) => { + const flagSrc = countryCode + ? `http://purecatamphetamine.github.io/country-flag-icons/3x2/${countryCode}.svg` + : ''; + return flagSrc ? ( + {countryCode} + ) : null; +}; + +const ArtInfo = ({ artItem }) => ( + + +
+

{artItem.name}

+

+ by {artItem.artistInfo.name} +

+
+
+ +

{artItem.description}

+

+ Year: + {artItem.date} +

+

+ Style: + {artItem.style} +

+

+ Dimensions: + {artItem.dimensions} +

+
+ Location: + {artItem.location} + +
+
+
+); +const ArtistDetails = ({ artistInfo }) => ( + + + {artistInfo.name} +
+

{artistInfo.name}

+
+ {artistInfo.nationality} + +
+
+
+ +

{artistInfo.bio}

+

+ Birth Year: + {artistInfo.birthYear} +

+

+ Death Year: + {artistInfo.deathYear || 'N/A'} +

+

+ Notable Works: + {artistInfo.notableWorks.join(', ')} +

+
+
+); + const ArtDescription = () => { const { id } = useParams(); - const artItem = findArtItemById(id); + const artItem = getArtItemById(id); if (!artItem) { return
Artwork not found
; } - - const flagSrc = getFlagSrc(artItem.countryCode); - return (
- {/* Image Section */}
{ className="shadow-lg rounded-lg" />
- - {/* Info Section */}
- - {/* Card Header */} - -
-

- {artItem.name} -

-

- by {artItem.artistInfo.name} -

-
-
- - {/* Card Body */} - -
{artItem.description}
- -
- Year: - {artItem.date} -
-
- Style: - {artItem.style} -
-
- Dimensions: - {artItem.dimensions} -
- - {/* Location Detail */} -
- Location: - {artItem.location} - {flagSrc && ( - {artItem.countryCode} - )} -
-
-
+
- - - {/* Card Header */} - -

- {artItem.artistInfo.name} -

-
- - {/* Card Body */} - -
{artItem.artistInfo.bio}
-
- Birth Year: - {artItem.artistInfo.birthYear} -
-
- Death Year: - {artItem.artistInfo.deathYear || 'N/A'} -
-
- Nationality: - {artItem.artistInfo.nationality} -
- {/* Add other artist information fields here */} -
-
+
@@ -117,20 +137,4 @@ const ArtDescription = () => { ); }; -const findArtItemById = (id) => { - for (const listKey in allLists) { - if (Object.prototype.hasOwnProperty.call(allLists, listKey)) { - const item = allLists[listKey].find((item) => item.id.toString() === id); - if (item) return item; - } - } - return null; -}; - -const getFlagSrc = (countryCode) => { - return countryCode - ? `http://purecatamphetamine.github.io/country-flag-icons/3x2/${countryCode}.svg` - : ''; -}; - export default ArtDescription;