Skip to content

Commit

Permalink
Refactor handleSelect function to use index instead of columnIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
chimpdev committed Sep 13, 2024
1 parent 0864021 commit 652bf43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/app/(dashboard)/components/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ export default function Table({ tabs }) {
'p-2 h-[60px] border-y border-[rgba(var(--bg-tertiary))] transition-colors group-hover:cursor-pointer',
selectedIndexes.includes(columnIndex) ? 'bg-tertiary border-[rgba(var(--bg-quaternary))] select-none' : 'group-hover:bg-secondary'
)}
onClick={() => handleSelect(columnIndex)}
onClick={() => handleSelect(currentTabData.columns.indexOf(column))}
>
<div
className='flex items-center gap-x-2'
>
{rowIndex === 0 && (
<div
className='flex items-center cursor-pointer gap-x-2 group'
onClick={() => handleSelect(columnIndex)}
onClick={() => handleSelect(currentTabData.columns.indexOf(column))}
>
<button className={cn(
'w-[18px] h-[18px] flex justify-center items-center border-2 outline-none hover:bg-[rgba(var(--border-primary))] transition-colors border-primary rounded-md',
Expand Down

0 comments on commit 652bf43

Please sign in to comment.