2024-08-18 14:45:51 -05:00
|
|
|
import React from "react";
|
|
|
|
import Image from "next/image";
|
|
|
|
import { useImageProxy } from "@/hooks/useImageProxy";
|
|
|
|
import { formatUnixTimestamp } from "@/utils/time";
|
2024-09-10 15:44:08 -05:00
|
|
|
import GenericButton from "@/components/buttons/GenericButton";
|
2024-08-24 15:55:59 -05:00
|
|
|
const SelectedContentItem = ({ content, onRemove }) => {
|
2024-09-15 15:15:58 -05:00
|
|
|
console.log('content:', content);
|
2024-08-18 14:45:51 -05:00
|
|
|
const { returnImageProxy } = useImageProxy();
|
|
|
|
|
|
|
|
return (
|
2024-08-24 15:55:59 -05:00
|
|
|
<div className="w-full border-2 rounded-lg border-gray-700 p-2 rounded-tr-none rounded-br-none relative">
|
2024-09-10 15:44:08 -05:00
|
|
|
<GenericButton
|
2024-08-24 15:55:59 -05:00
|
|
|
icon="pi pi-times"
|
|
|
|
className="absolute top-2 right-2 py-1 px-2 w-auto h-auto"
|
|
|
|
severity="danger"
|
|
|
|
size="small"
|
|
|
|
rounded
|
|
|
|
onClick={onRemove}
|
|
|
|
/>
|
2024-08-18 14:45:51 -05:00
|
|
|
<div className="flex flex-row gap-4">
|
|
|
|
<Image
|
|
|
|
alt="content thumbnail"
|
|
|
|
src={returnImageProxy(content.image)}
|
|
|
|
width={50}
|
|
|
|
height={50}
|
|
|
|
className="w-[100px] h-[100px] object-cover object-center border-round"
|
|
|
|
/>
|
|
|
|
<div className="flex-1 max-w-[80vw]">
|
|
|
|
<div className="text-lg text-900 font-bold">{content.title}</div>
|
|
|
|
<div className="w-full text-sm text-600 text-wrap">{content.summary}</div>
|
|
|
|
<div className="text-sm pt-6 text-gray-500">
|
2024-08-23 16:52:47 -05:00
|
|
|
{content.published_at ? `Published: ${formatUnixTimestamp(content.published_at)}` : "not yet published"}
|
2024-08-18 14:45:51 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-08-24 15:55:59 -05:00
|
|
|
export default SelectedContentItem;
|