♻️ refactor: change project bar item component to button

This commit is contained in:
Wahyu Kurniawan 2024-03-06 15:14:09 +07:00
parent 7aac8cdcef
commit 8d3ef369bb
No known key found for this signature in database
GPG Key ID: 040A1549143A8E33

View File

@ -11,7 +11,7 @@ import { getInitials } from 'utils/geInitials';
* @type {MergedComponentPropsWithoutRef}
*/
type MergedComponentPropsWithoutRef = OmitCommon<
ComponentPropsWithoutRef<'div'>,
ComponentPropsWithoutRef<'button'>,
Omit<
Overwrite<UseComboboxGetItemPropsReturnValue, Project[]>,
'index' | 'item'
@ -24,16 +24,16 @@ interface ProjectSearchBarItemProps extends MergedComponentPropsWithoutRef {
}
const ProjectSearchBarItem = forwardRef<
HTMLDivElement,
HTMLButtonElement,
ProjectSearchBarItemProps
>(({ item, active, ...props }, ref) => {
return (
<div
<button
{...props}
ref={ref}
key={item.id}
className={cn(
'px-2 py-2 flex items-center gap-3 rounded-lg hover:bg-base-bg-emphasized',
'px-2 py-2 flex items-center gap-3 rounded-lg text-left hover:bg-base-bg-emphasized',
{
'bg-base-bg-emphasized': active,
},
@ -50,7 +50,7 @@ const ProjectSearchBarItem = forwardRef<
</p>
<p className="text-xs text-elements-low-em">{item.organization.name}</p>
</div>
</div>
</button>
);
});