hover states

This commit is contained in:
Nate Kelley 2025-09-30 09:25:41 -06:00
parent d0e3b811e5
commit 71b795abc1
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 33 additions and 28 deletions

View File

@ -26,6 +26,7 @@ export const useCreateShortcutsMentionsSuggestions = (
setOpenCreateShortcutModal: (open: boolean) => void
) => {
const navigate = useNavigate();
const createShortcutForMention = useCreateShortcutForMention();
return useMemo(
() =>
@ -68,6 +69,7 @@ export const useCreateShortcutsMentionsSuggestions = (
);
};
export const useCreateShortcutForMention = () => {
const createShortcutForMention = (shortcut: Shortcut): MentionTriggerItem<string> => {
return {
value: shortcut.id,
@ -97,11 +99,15 @@ const createShortcutForMention = (shortcut: Shortcut): MentionTriggerItem<string
),
};
};
return createShortcutForMention;
};
export const useShortcutsSuggestions = (
shortcuts: ListShortcutsResponse['shortcuts'],
setOpenCreateShortcutModal: (open: boolean) => void,
mentionInputSuggestionsRef: React.RefObject<MentionInputSuggestionsRef | null>
): MentionInputSuggestionsProps['suggestionItems'] => {
const createShortcutForMention = useCreateShortcutForMention();
return useMemo(() => {
const shortcutsItems = shortcuts.map<MentionInputSuggestionsDropdownItem>((shortcut) => {
return {

View File

@ -17,7 +17,7 @@ export const MentionSecondaryContentDropdown = ({
<Button
variant={'ghost'}
className={cn(
'hover:bg-item-active hidden group-data-[selected=true]/mention-list-item:flex -mr-1.5',
'hover:bg-item-active hidden group-hover/mention-list-item:flex group-data-[selected=true]/mention-list-item:flex -mr-1.5',
open && 'flex!'
)}
prefix={<Dots />}

View File

@ -1,6 +1,5 @@
import { Command, useCommandState } from 'cmdk';
import { Command } from 'cmdk';
import type React from 'react';
import { useMount } from '@/hooks/useMount';
import { cn } from '@/lib/utils';
import { Popover } from '../../popover';
import type {