init: чистый старт Laravel + Vuexy
This commit is contained in:
23
resources/ts/views/apps/chat/useChat.ts
Normal file
23
resources/ts/views/apps/chat/useChat.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { Chat, ChatContact, ChatStatus } from '@db/apps/chat/types'
|
||||
|
||||
export type ActiveChat = {
|
||||
chat?: Chat
|
||||
contact: ChatContact
|
||||
} | null
|
||||
|
||||
export const useChat = () => {
|
||||
const resolveAvatarBadgeVariant = (status: ChatStatus) => {
|
||||
if (status === 'online')
|
||||
return 'success'
|
||||
if (status === 'busy')
|
||||
return 'error'
|
||||
if (status === 'away')
|
||||
return 'warning'
|
||||
|
||||
return 'secondary'
|
||||
}
|
||||
|
||||
return {
|
||||
resolveAvatarBadgeVariant,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user