<template>
    <div class="bg-white p-8 rounded-lg shadow-lg max-w-lg w-full text-center">
      <img src="./assets/logo.png" alt="Logo Polo Informatico" class="w-3/4 mx-auto mb-6">
      <h1 class="text-2xl font-semibold mb-4">Download software di assistenza Polo Informatico</h1>
      <p class="text-gray-600 mb-4">Si prega di leggere e accettare l'accordo per scaricare il software.</p>
  
      <AgreementComponent v-model="isAgreementAccepted" />
  
      <div class="flex flex-col items-center mt-4 space-y-3">
        <DownloadButtonComponent 
          v-for="(file, index) in downloadFiles" 
          :key="index" 
          :file="file"
          :disabled="!isAgreementAccepted">
        </DownloadButtonComponent>
      </div>
    </div>
    <div class="text-gray-500 text-sm mt-4 flex justify-center items-center">
  <div>&copy; 2024 Polo Informatico s.r.l. Tutti i diritti riservati.</div>
</div>

  </template>
  
  <script>
  import AgreementComponent from './components/AgreementComponent.vue';
  import DownloadButtonComponent from './components/DownloadButtonComponent.vue';
  import { ref } from 'vue';
  
  export default {
    components: {
      AgreementComponent,
      DownloadButtonComponent,
    },
    setup() {
      const isAgreementAccepted = ref(false);
  
      const downloadFiles = [
        { name: 'assistenzapoloinformatico.exe', label: 'Download per Windows', icon: 'https://upload.wikimedia.org/wikipedia/commons/5/5f/Windows_logo_-_2012.svg', alt: 'Windows' },
        { name: 'assistenzapoloinformatico-arm64.dmg', label: 'Download per Mac OS (ARM)', icon: 'https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg', alt: 'MacOS ARM' },
        { name: 'assistenzapoloinformatico-x64.dmg', label: 'Download per Mac OS (Intel)', icon: 'https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg', alt: 'MacOS Intel' },
        { name: 'assistenzapoloinformatico.apk', label: 'Download per Android', icon: 'https://upload.wikimedia.org/wikipedia/commons/d/d7/Android_robot.svg', alt: 'Android' },
      ];
  
      return {
        isAgreementAccepted,
        downloadFiles,
      };
    },
  };
  </script>
  