diff --git a/src/components/App/SideBar/AiSummary/AiSources/index.tsx b/src/components/App/SideBar/AiSummary/AiSources/index.tsx index fed7a3652..4ffc2ff72 100644 --- a/src/components/App/SideBar/AiSummary/AiSources/index.tsx +++ b/src/components/App/SideBar/AiSummary/AiSources/index.tsx @@ -66,7 +66,6 @@ const _AiSources = ({ sourceIds }: Props) => { image_url: imageUrl, date, boost, - episode_title: episodeTitle, show_title: showTitle, node_type: nodeType, text, @@ -82,7 +81,6 @@ const _AiSources = ({ sourceIds }: Props) => { key={index.toString()} boostCount={boost || 0} date={date || 0} - episodeTitle={formatDescription(episodeTitle)} imageUrl={imageUrl || ''} name={name || ''} node={n} diff --git a/src/components/App/SideBar/Media/index.tsx b/src/components/App/SideBar/Media/index.tsx index 0cf8d94be..2b8faccf4 100644 --- a/src/components/App/SideBar/Media/index.tsx +++ b/src/components/App/SideBar/Media/index.tsx @@ -6,7 +6,6 @@ import { Flex } from '~/components/common/Flex' import { useAppStore } from '~/stores/useAppStore' import { useSelectedNode } from '~/stores/useGraphStore' import { NodeExtended } from '~/types' -import { formatDescription } from '~/utils/formatDescription' import { BoostAmt } from '../../Helper/BoostAmt' import { Description } from '../Description' import { Episode } from '../Relevance/Episode' @@ -28,7 +27,6 @@ export const Media = ({ node }: Props) => { node_type: nodeType, id, show_title: showTitle, - episode_title: episodeTitle, ref_id: refId, } = node || selectedNode || {} @@ -51,7 +49,6 @@ export const Media = ({ node }: Props) => { null} diff --git a/src/components/App/SideBar/Relevance/Episode/Default/index.tsx b/src/components/App/SideBar/Relevance/Episode/Default/index.tsx index fecdc575a..0999f6fd8 100644 --- a/src/components/App/SideBar/Relevance/Episode/Default/index.tsx +++ b/src/components/App/SideBar/Relevance/Episode/Default/index.tsx @@ -11,11 +11,11 @@ import { useAppStore } from '~/stores/useAppStore' import { useSchemaStore } from '~/stores/useSchemaStore' import { NodeExtended } from '~/types' import { colors } from '~/utils/colors' +import { truncateText } from '~/utils/truncateText' export type Props = { boostCount: number date: number - episodeTitle: string imageUrl?: string showTitle?: string sourceLink?: string @@ -24,20 +24,9 @@ export type Props = { node: NodeExtended } -export const Default = ({ - boostCount, - date, - episodeTitle, - imageUrl, - showTitle, - type, - newName, - sourceLink, - node, -}: Props) => { +export const Default = ({ boostCount, date, imageUrl, showTitle, type, newName, sourceLink, node }: Props) => { const searchTerm = useAppStore((s) => s.currentSearch) const { getNodeKeysByType } = useSchemaStore((s) => s) - const descriptionSource = type === 'show' ? showTitle : episodeTitle const subtitleSource = type === 'show' ? '' : showTitle const subtitle = highlightSearchTerm(String(subtitleSource), searchTerm) as string @@ -45,13 +34,11 @@ export const Default = ({ const { properties = {} } = node - const [titleDraft = '', subtitleDraft = ''] = nodeKeys.map((key) => properties[key] || '') + const [titleDraft = ''] = nodeKeys.map((key) => properties[key] || '') const nameDraft = titleDraft || newName - const descriptionDraft = subtitleDraft || descriptionSource const name = highlightSearchTerm(String(nameDraft), searchTerm) as string - const description = highlightSearchTerm(String(descriptionDraft), searchTerm) as string return ( @@ -78,7 +65,9 @@ export const Default = ({ {name && {name}} - {description && {description}} + {node?.properties?.summary && ( + {truncateText(node?.properties?.summary, 20)} + )} {Boolean(date) && {moment.unix(date).fromNow()}} {Boolean(subtitle) && {subtitle}} diff --git a/src/components/App/SideBar/Relevance/Episode/index.tsx b/src/components/App/SideBar/Relevance/Episode/index.tsx index 90451ee89..5f30844a6 100644 --- a/src/components/App/SideBar/Relevance/Episode/index.tsx +++ b/src/components/App/SideBar/Relevance/Episode/index.tsx @@ -41,7 +41,6 @@ const EpisodeWrapper = styled(Flex).attrs({ export type Props = { boostCount: number date: number - episodeTitle: string imageUrl?: string showTitle?: string text?: string @@ -58,7 +57,6 @@ export type Props = { export const Episode = ({ boostCount, date, - episodeTitle, imageUrl, showTitle, type, @@ -85,7 +83,6 @@ export const Episode = ({ { image_url: imageUrl, date, boost, - episode_title: episodeTitle, show_title: showTitle, node_type: nodeType, text, @@ -100,7 +99,6 @@ const _Relevance = ({ isSearchResult }: Props) => { key={adaptedNode.ref_id} boostCount={boost || 0} date={date || 0} - episodeTitle={formatDescription(episodeTitle)} imageUrl={imageUrl || ''} name={name || ''} node={n}