{!debouncedQuery && (
Type to search across all messages
)}
{debouncedQuery && results.length === 0 && !loading && (
No messages found for “{debouncedQuery}”
)}
{results.map((result) => {
const convName = getConversationName(result);
const typeBadge = result.type === 'CHAN' ? 'Channel' : 'DM';
return (
handleResultClick(result)}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleResultClick(result);
}
}}
>
{typeBadge}
{convName}
{formatTime(result.received_at)}
{result.sender_name && !result.outgoing && (
{result.sender_name}:
)}
{result.outgoing && You: }
{highlightMatch(
result.sender_name && result.text.startsWith(`${result.sender_name}: `)
? result.text.slice(result.sender_name.length + 2)
: result.text,
debouncedQuery
)}
);
})}
{loading && (
Searching...
)}
{hasMore && !loading && (
)}