import { Card, Col, Image, Row, Space } from "antd"; import { ContentImage } from "./Image"; import { CreativeSearchItem } from "../overmind/lists"; import { Link } from "react-router-dom"; import { MoodReadResponse, PostReadResponse } from "@newstackdev/iosdk-newgraph-client-js"; import { NLView } from "../types"; import { aestheticList } from "../overmind/lists/SearchCreative/aestheticList"; import { useAppState } from "../overmind"; import Paragraph from "antd/lib/typography/Paragraph"; export interface OpenSearchResponse { _index: string; _type: string; _id: string; _score: null; _source: OpenSearchDocument; sort: number[]; } export interface OpenSearchDocument { image: string; content: { [key: string]: number }; aesthetics: { [key: string]: number }; meta: Meta; } export type Aesthetics = Record; export interface Meta { blog_name: string; id: number; date: string; tags: string[]; short_url: string; summary: string; } export const SearchItemWidget: NLView<{ item: any; index: number }> = ({ item, index }) => { const state = useAppState(); return ( } > {item?.meta?.short_url}
by{" "} {item?.meta?.blog_name}
{Object.entries(item?.aesthetics ?? {}) .filter((kvp) => aestheticList.includes(kvp[0])) .map((kvp) => (

{kvp[0]}

))}
); };