interface UserWidgetsProps {
user: {
currentlyListening?: string;
currentlyReading?: {
title?: string;
author?: string;
coverImage?: string;
};
currentlyWatching?: {
title?: string;
platform?: string;
posterImage?: string;
};
};
}
export default function UserWidgets({ user }: UserWidgetsProps) {
return (
<div>
{user.currentlyListening && (
<div className="mb-4">
<iframe
src={`${user.currentlyListening}`}
width="100%"
height="80"
frameBorder="0"
allowTransparency="true"
allow="encrypted-media"
></iframe>
</div>
)}
{user.currentlyReading && (
<div className="mb-4 bg-orange-300 rounded-lg p-4">
<div className="flex items-center">
<img
src={user.currentlyReading.coverImage}
alt={user.currentlyReading.title}
className="w-20 h-28 mr-4"
/>
<div>
<p className="text-lg font-semibold">{user.currentlyReading.title}</p>
<p className="text-sm text-gray-500">{user.currentlyReading.author}</p>
</div>
</div>
</div>
)}
{user.currentlyWatching && (
<div className="mb-4 bg-white rounded-lg p-4">
<div className="flex items-center">
<img
src={user.currentlyWatching.posterImage}
alt={user.currentlyWatching.title}
className="w-20 h-28 mr-4"
/>
<div>
<p className="text-lg font-semibold">{user.currentlyWatching.title}</p>
<p className="text-sm text-gray-500">on {user.currentlyWatching.platform}</p>
</div>
</div>
</div>
)}
</div>
);
}