import React, { useState } from 'react'
import Modal from '../ui/Modal'
function EvolutionArtworkCard({ card }) {
if (!card) return null
const shouldBlur = Boolean(card?.maturity?.should_blur)
return (
{card.thumbnail ? (

) : (
)}
{card.role_label}
{shouldBlur ? (
Mature artwork preview is softened for your current viewer settings.
) : null}
{card.content_type ? {card.content_type} : null}
{card.category ? {card.category} : null}
{card.title}
{card.publisher}
{card.year ? {card.year} : null}
)
}
function ComparisonModal({ item, open, onClose }) {
if (!item) return null
return (
{item.heading}
{item.relation_label}
{item.summary}
{item.years_apart_label ? (
{item.years_apart_label}
) : null}
{[item.before, item.after].map((card) => (
{card.role_label}
{card.title}
Open
{card.image_lg ? (

) : (
)}
{card.publisher}
{card.year ? {card.year} : null}
{card.category ? {card.category} : null}
))}
{item.note ? (
) : null}
)
}
function EvolutionStoryBlock({ item, onCompare }) {
if (!item) return null
return (
{item.heading}
{item.relation_label}
{item.summary}
{item.years_apart_label ? (
{item.years_apart_label}
) : null}
{item.compare?.available ? (
) : null}
{item.note ? (
) : null}
)
}
function EvolutionUpdates({ updates, onCompare }) {
if (!updates?.length) return null
return (
Updated Versions
This piece has later evolutions
Follow how the creator revisited the idea over time.
{updates.map((item) => (
{item.heading}
{item.after?.title}
{item.summary}
{item.years_apart_label ? (
{item.years_apart_label}
) : null}
{item.compare?.available ? (
) : null}
{item.note ? {item.note}
: null}
))}
)
}
export default function ArtworkEvolutionPanel({ evolution }) {
const [compareItem, setCompareItem] = useState(null)
if (!evolution?.primary && !evolution?.updates?.length) {
return null
}
return (
<>
{evolution.primary ? : null}
{evolution.updates?.length ? : null}
setCompareItem(null)} />
>
)
}