|
|
|
@ -1,10 +1,4 @@ |
|
|
|
import { |
|
|
|
import { Command, CommandInput, CommandItem, CommandList } from '@/components/ui/command' |
|
|
|
Command, |
|
|
|
|
|
|
|
CommandGroup, |
|
|
|
|
|
|
|
CommandInput, |
|
|
|
|
|
|
|
CommandItem, |
|
|
|
|
|
|
|
CommandList |
|
|
|
|
|
|
|
} from '@/components/ui/command' |
|
|
|
|
|
|
|
import { Textarea } from '@/components/ui/textarea' |
|
|
|
import { Textarea } from '@/components/ui/textarea' |
|
|
|
import { useSearchProfiles } from '@/hooks' |
|
|
|
import { useSearchProfiles } from '@/hooks' |
|
|
|
import { pubkeyToNpub } from '@/lib/pubkey' |
|
|
|
import { pubkeyToNpub } from '@/lib/pubkey' |
|
|
|
@ -159,31 +153,29 @@ export default function TextareaWithMentions({ |
|
|
|
<Command |
|
|
|
<Command |
|
|
|
ref={dropdownRef} |
|
|
|
ref={dropdownRef} |
|
|
|
className={cn( |
|
|
|
className={cn( |
|
|
|
'sm:fixed hidden translate-y-2 h-auto max-h-44 w-full sm:w-[462px] z-10 overflow-auto border border-popover shadow' |
|
|
|
'sm:fixed hidden translate-y-2 h-auto w-full sm:w-[462px] z-10 border border-popover shadow' |
|
|
|
)} |
|
|
|
)} |
|
|
|
shouldFilter={false} |
|
|
|
shouldFilter={false} |
|
|
|
> |
|
|
|
> |
|
|
|
<div className="hidden"> |
|
|
|
<div className="hidden"> |
|
|
|
<CommandInput ref={inputRef} value={commandValue} /> |
|
|
|
<CommandInput ref={inputRef} value={commandValue} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<CommandList> |
|
|
|
<CommandList scrollAreaClassName="h-44"> |
|
|
|
<CommandGroup> |
|
|
|
{profiles.map((p) => { |
|
|
|
{profiles.map((p) => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<CommandItem |
|
|
|
<CommandItem |
|
|
|
key={p.pubkey} |
|
|
|
key={p.pubkey} |
|
|
|
value={`nostr:${pubkeyToNpub(p.pubkey)}`} |
|
|
|
value={`nostr:${pubkeyToNpub(p.pubkey)}`} |
|
|
|
onSelect={onCommandSelect} |
|
|
|
onSelect={onCommandSelect} |
|
|
|
> |
|
|
|
> |
|
|
|
<div className="flex gap-2 items-center pointer-events-none truncate"> |
|
|
|
<div className="flex gap-2 items-center pointer-events-none"> |
|
|
|
<SimpleUserAvatar userId={p.pubkey} /> |
|
|
|
<SimpleUserAvatar userId={p.pubkey} /> |
|
|
|
<SimpleUsername userId={p.pubkey} className="font-semibold truncate" /> |
|
|
|
<SimpleUsername userId={p.pubkey} className="font-semibold" /> |
|
|
|
<Nip05 pubkey={p.pubkey} /> |
|
|
|
<Nip05 pubkey={p.pubkey} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</CommandItem> |
|
|
|
</CommandItem> |
|
|
|
) |
|
|
|
) |
|
|
|
})} |
|
|
|
})} |
|
|
|
|
|
|
|
</CommandGroup> |
|
|
|
|
|
|
|
</CommandList> |
|
|
|
</CommandList> |
|
|
|
</Command> |
|
|
|
</Command> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|