<template>
  <div class="quick-actions-section">
    <div class="section-header">
      <el-icon class="header-icon"><Pointer /></el-icon>
      <span class="header-title">{{ TEXT.common.labels.quickActions }}</span>
    </div>
    <div class="actions-grid">
      <div 
        v-for="item in actions" 
        :key="item.path" 
        class="action-item"
        @click="go(item.path)"
      >
        <div class="action-icon-wrapper">
          <el-icon><component :is="item.icon" /></el-icon>
        </div>
        <span class="action-label">{{ item.label }}</span>
        <el-icon class="action-arrow"><ArrowRight /></el-icon>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
import { 
  Pointer, ArrowRight, Timer, UserFilled,
  Management, Money, Collection 
} from "@element-plus/icons-vue";
import { TEXT } from "../locales";

const router = useRouter();

const actions = [
  { label: TEXT.menu.startupFeasibilityEthics, path: "/startup/feasibility-ethics", icon: Timer },
  { label: TEXT.menu.startupMeetingAuth, path: "/startup/meeting-auth", icon: Timer },
  { label: TEXT.menu.subjects, path: "/subjects", icon: UserFilled },
  { label: TEXT.menu.drugShipments, path: "/drug/shipments", icon: Management },
  { label: TEXT.menu.finance, path: "/fees/contracts", icon: Money },
  { label: TEXT.menu.knowledgeMedicalConsult, path: "/knowledge/medical-consult", icon: Collection },
];

const go = (path: string) => router.push(path);
</script>

<style scoped>
.quick-actions-section {
  background-color: #fff;
  border-radius: var(--ctms-radius);
  padding: 24px;
  border: 1px solid var(--ctms-border-color);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.header-icon {
  font-size: 16px;
  color: var(--ctms-text-secondary);
}

.header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ctms-text-main);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.action-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #ffffff;
  border: 1px solid var(--ctms-border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--ctms-transition);
  position: relative;
  overflow: hidden;
}

.action-item:hover {
  background-color: #ffffff;
  border-color: var(--ctms-border-color-hover);
}

.action-icon-wrapper {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 12px;
  color: var(--ctms-text-secondary);
  background-color: var(--ctms-bg-muted);
}

.action-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ctms-text-main);
  flex: 1;
}

.action-arrow {
  font-size: 14px;
  color: var(--ctms-text-disabled);
  opacity: 1;
  transition: var(--ctms-transition);
}

.action-item:hover .action-arrow {
  color: var(--ctms-text-secondary);
}
</style>
