import React from 'react'; import { Link } from 'react-router-dom'; import { ArrowRightIcon, StarIcon, CalendarBlankIcon, } from '@phosphor-icons/react'; import { motion } from 'framer-motion'; import GenerativeArt from './GenerativeArt'; import colors from '../config/colors'; const LogCard = ({ log, index, totalLogs, viewMode = 'grid' }) => { const { title, category, author, by, director, artist, creator, date, rating, slug, image, platform, source, } = log; // Resolve the primary creator/source const creatorName = by || author || artist || creator || director; const sourceName = platform || source; const categoryColor = colors[category.toLowerCase()] || colors.primary[400]; const categoryColorLight = colors[category.toLowerCase() + '-light'] || categoryColor; if (viewMode === 'list') { return ( {/* Index & Date */} #{String(totalLogs - index).padStart(3, '0')} {date} {/* Visual Thumbnail (Small) */} {image ? ( ) : ( )} {/* Main Content */} {category} {category === 'Reading' && log.status && ( {log.status} )} {rating > 0 && ( {rating} {[...Array(5)].map((_, i) => ( ))} )} {title} {creatorName && ( BY {creatorName} )} {/* Source & Action */} {sourceName && ( {sourceName} )} ); } return ( {/* Visual Header */} {image ? ( ) : ( )} {/* Category Badge */} {category} {category === 'Reading' && log.status && ( {log.status} )} {/* Rating Badge */} {rating > 0 && ( {rating} )} {/* Content */} {date} • #{String(totalLogs - index).padStart(3, '0')} {title} {creatorName && ( By {creatorName} )} {sourceName && ( On {sourceName} )} View Log ); }; export default LogCard;
BY {creatorName}
By {creatorName}
On {sourceName}