-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add more detail to the analysis
- Loading branch information
1 parent
1351494
commit 1a811ee
Showing
6 changed files
with
98 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,40 @@ | ||
/* eslint-disable jsx-a11y/anchor-is-valid */ | ||
import { CategoryEnum } from '../../../electron/devHistory/services/openai-service' | ||
import { AtSymbolIcon, PencilSquareIcon } from '@heroicons/react/24/outline' | ||
import { IncrementAnalysis } from '../../../electron/devHistory/models/IncrementAnalysis' | ||
import { colorMap, defaultColor } from './colorMap' | ||
|
||
export function ScheduledItem({ | ||
item, | ||
onClick, | ||
}: { | ||
item: { category: CategoryEnum; text: string } | ||
item: IncrementAnalysis | ||
onClick: () => void | ||
}) { | ||
const color = colorMap.get(item.category) || defaultColor | ||
const cat = item.raw.analysis?.summary?.category || 'other' | ||
const text = item.summary | ||
const hasBlogPosts = item.raw.analysis?.blogPosts?.length || 0 | ||
const hasTweets = item.raw.analysis?.tweets?.length || 0 | ||
const color = colorMap.get(cat) || defaultColor | ||
|
||
return ( | ||
<button | ||
onClick={onClick} | ||
className={`absolute flex flex-col p-2 overflow-y-auto text-xs rounded-lg group inset-1 ${color.bg} leading-5 ${color.bgDark}`} | ||
className={`absolute flex flex-col p-2 overflow-y-auto text-xs rounded-lg group inset-1 ${color.textDark} ${color.bg} leading-5 ${color.bgDark}`} | ||
> | ||
{/* <p className={`order-1 font-semibold ${color.textDark}`}> | ||
{item.category} | ||
</p> */} | ||
<p className={`order-1 ${color.text} ${color.hoverTextDark}`}> | ||
<span className={`font-semibold ${color.textDark}`}> | ||
{'[ '} | ||
{item.category} {' ] - '} | ||
</span> | ||
{item.text} | ||
</p> | ||
<div className="flex gap-x-3 items-center inline"> | ||
<p className={`font-semibold`}>{`[ ${cat}`}</p> | ||
{hasBlogPosts ? ( | ||
<PencilSquareIcon | ||
title="click to view blog posts" | ||
className="w-3 h-3" | ||
/> | ||
) : null} | ||
{hasTweets ? ( | ||
<AtSymbolIcon title="click to view tweets" className="w-3 h-3" /> | ||
) : null}{' '} | ||
<p className={`font-semibold `}> {'] - '}</p> | ||
</div> | ||
<p className={`${color.text} ${color.hoverTextDark}`}>{text}</p> | ||
</button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters