<template>
  <article class="task-card" :class="{ 'is-disabled': disabled }">
    <div class="task-info">
      <h3 class="task-title">
        {{ title }}
        <span class="task-progress">({{ progress }})</span>
      </h3>
      <div class="task-rewards">
        <span class="reward-item"><i class="reward-icon"></i>x20</span>
        <span class="reward-item"><i class="reward-icon"></i>x20</span>
      </div>
    </div>
    <button
      class="task-btn lx-btn lx-btn--lg lx-btn--short lx-btn--primary"
      type="button"
      :disabled="disabled"
    >
      前往
    </button>
  </article>
</template>

<script setup lang="ts">
defineProps<{
  title: string
  progress: string
  disabled?: boolean
}>()
</script>

<style scoped lang="scss">
.task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-radius: 12px;
  border: 1px solid #d3e1f0;
  background: #fff;
  padding: 24px 48px;

  &.is-disabled {
    opacity: 0.55;
  }
}

.task-info {
  display: flex;
  flex-direction: column;
}

.task-title {
  font-size: 32px;
  color: #333;
  font-weight: 500;
}

.task-progress {
  margin-left: 8px;
  color: var(--color-text-brand);
}

.task-rewards {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 8px;
  font-size: 28px;
  color: #333;
}

.reward-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reward-icon {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #eff3f8;
}

.task-btn {
  flex-shrink: 0;
}
</style>
