import type { StatusColor } from '../types'

export interface CardStatus {
  message: string
  description: string
  color: StatusColor
  icon: string
}

export function useCardStatus() {
  const cardStatus = ref<CardStatus>({
    message: '',
    description: '',
    color: 'neutral',
    icon: ''
  })

  function showStatus(
    message: string,
    description: string = '',
    color: StatusColor = 'neutral',
    icon: string = ''
  ) {
    cardStatus.value = {
      message,
      description,
      color,
      icon
    }
  }

  function clearStatus() {
    cardStatus.value = {
      message: '',
      description: '',
      color: 'neutral',
      icon: ''
    }
  }

  return {
    cardStatus,
    showStatus,
    clearStatus
  }
}
