import { Show } from "solid-js"; import type { SearchResult } from "@/types/source"; import { SourceBadge } from "./SourceBadge"; import { useTheme } from "@/context/ThemeContext"; import { SelectableBox, SelectableText } from "@/components/Selectable"; type ResultCardProps = { result: SearchResult; selected: boolean; onSelect: () => void; onSubscribe?: () => void; }; export function ResultCard(props: ResultCardProps) { const { theme } = useTheme(); const podcast = () => props.result.podcast; return ( props.selected} flexDirection="column" padding={1} onMouseDown={props.onSelect} > props.selected} primary > {podcast().title} [Subscribed] props.selected} tertiary > by {podcast().author} {(description) => ( props.selected} tertiary > {description().length > 120 ? description().slice(0, 120) + "..." : description()} )} 0}> {(podcast().categories ?? []).slice(0, 3).map((category) => ( [{category}] ))} { event.stopPropagation?.(); props.onSubscribe?.(); }} > [+] Add to Feeds ); }