2023-11-03 15:30:04 +01:00
|
|
|
import { Entity } from 'megalodon'
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
card: Entity.Card
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function Card(props: Props) {
|
|
|
|
const openCard = () => {
|
|
|
|
global.ipc.invoke('open-browser', props.card.url)
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
2023-12-02 17:00:32 +01:00
|
|
|
className="flex border-inherit border border-solid rounded-md w-full cursor-pointer overflow-hidden text-ellipsis mb-1"
|
2023-11-03 15:30:04 +01:00
|
|
|
onClick={openCard}
|
|
|
|
>
|
|
|
|
<div style={{ height: '60px', width: '60px' }}>
|
|
|
|
<img src={props.card.image} alt={props.card.title} className="w-full h-full" />
|
|
|
|
</div>
|
|
|
|
<div className="px-2" style={{ height: '60px', width: 'calc(100% - 60px)' }}>
|
|
|
|
<p className="text-ellipsis overflow-hidden w-full whitespace-nowrap">
|
|
|
|
<strong>{props.card.title}</strong>
|
|
|
|
</p>
|
|
|
|
<p className="text-ellipsis overflow-hidden w-full whitespace-nowrap">{props.card.description}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|