package com.isidroid.c23.ext

import androidx.compose.ui.graphics.Color
import com.isidroid.c23.R
import com.isidroid.c23.ui.theme.ColorBlue
import com.isidroid.c23.ui.theme.ColorGreen
import com.isidroid.c23.ui.theme.ColorOrange
import com.isidroid.c23.ui.theme.ColorRed
import com.isidroid.job.constant.JobStatus

fun getPrintJobStatus(@JobStatus status: Int) = when (status) {
    JobStatus.CREATED -> R.string.print_job_status_created
    JobStatus.CANCELED -> R.string.print_job_status_canceled
    JobStatus.READY -> R.string.print_job_status_ready
    JobStatus.ACCEPTED -> R.string.print_job_status_accepted
    JobStatus.REJECTED -> R.string.print_job_status_rejected
    JobStatus.PRINTING -> R.string.print_job_status_printing
    JobStatus.COMPLETED -> R.string.print_job_status_completed
    JobStatus.ERROR -> R.string.print_job_status_error
    JobStatus.IDLE -> R.string.print_job_status_idle
    JobStatus.RENDER_UPLOAD -> R.string.print_job_status_render_upload
    JobStatus.READY_TO_PRINT -> R.string.print_job_status_ready_to_print
    JobStatus.UPLOAD_ERROR -> R.string.print_job_status_upload_error

    JobStatus.RENDERED -> R.string.print_job_status_rendered
    JobStatus.SENDING -> R.string.print_job_status_sending

    else -> R.string.empty
}



fun getPrintJobStatusColor(@JobStatus status: Int) = when (status) {
    JobStatus.CREATED -> ColorBlue
    JobStatus.CANCELED -> ColorOrange
    JobStatus.READY -> ColorGreen
    JobStatus.ACCEPTED -> ColorGreen
    JobStatus.REJECTED -> ColorOrange
    JobStatus.PRINTING -> ColorBlue
    JobStatus.COMPLETED -> ColorGreen
    JobStatus.ERROR -> ColorRed
    JobStatus.IDLE -> ColorBlue
    JobStatus.RENDER_UPLOAD -> ColorBlue
    JobStatus.READY_TO_PRINT -> ColorBlue
    JobStatus.UPLOAD_ERROR -> ColorRed
    JobStatus.RENDERED -> ColorOrange
    JobStatus.SENDING -> ColorOrange
    else -> Color.Transparent
}