Skip to content

Commit 915d76c

Browse files
committed
Wire-up title clicking also.
1 parent 37a9f49 commit 915d76c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/CommentRow.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Badge from '@/components/Badge'
22
import { timeAgo } from '@/components/misc'
33
import type { CommentTableRow } from '@/entrypoints/background'
4+
import { switchToTab } from '@/entrypoints/popup/popup'
45
import { EnhancerRegistry } from '@/lib/registries'
56

67
const enhancers = new EnhancerRegistry()
@@ -15,6 +16,10 @@ type CommentRowProps = {
1516

1617
export function CommentRow({ row, selectedIds, toggleSelection }: CommentRowProps) {
1718
const enhancer = enhancers.enhancerFor(row.spot)
19+
20+
const handleTitleClick = () => {
21+
switchToTab(row.spot.unique_key)
22+
}
1823
return (
1924
<tr className='hover:bg-gray-50'>
2025
<td className='px-3 py-3'>
@@ -50,9 +55,13 @@ export function CommentRow({ row, selectedIds, toggleSelection }: CommentRowProp
5055

5156
{/* Title */}
5257
<div className='flex items-center gap-1'>
53-
<a href='TODO' className='truncate font-medium text-sm hover:underline'>
58+
<button
59+
type='button'
60+
onClick={handleTitleClick}
61+
className='cursor-pointer truncate text-left font-medium text-sm hover:underline'
62+
>
5463
{enhancer.tableTitle(row.spot)}
55-
</a>
64+
</button>
5665
<Badge type={row.isSent ? 'sent' : 'unsent'} />
5766
{row.isTrashed && <Badge type='trashed' />}
5867
</div>

0 commit comments

Comments
 (0)