Files
vue-chat-layer/app/lib/slots.ts
Jakub Zych 764cb42894 refactor: the DM-only conversation-actions rule as a helper
dmActionsTarget (app/lib/slots.ts) answers the open DM's row or null;
ChatHeader renders the slot from it. Same behaviour, testable outside a
component.
2026-11-01 19:17:42 +01:00

12 lines
503 B
TypeScript

// The layer's slot rules, shared by the components that render the slots.
import type { ChatConversationRow } from './types'
/**
* dmActionsTarget is the conversation the conversation-actions slot renders
* for: the open DM's row when it is a DM, else null (channels never show
* the slot, so a call button placed in it appears in DMs only).
*/
export function dmActionsTarget(dm: ChatConversationRow | null | undefined): ChatConversationRow | null {
return dm && dm.type === 'dm' ? dm : null
}