<script setup lang="ts">
import { Resume, ResumeComponentPlacement } from '@/types/resume';
import ResumeComponent from './ResumeComponent.vue';

const props = defineProps<{
    resume: Resume,
    selectedComponent: ResumeComponentPlacement | null
}>();

const emit = defineEmits(['selected-component-change']);
</script>

<template>
    <div class="flex-2 w-full p-6">
        <div id="resume" class="aspect-[0.707317073] w-full max-w-[84.1cm] bg-white text-black">
            <ResumeComponent v-for="componentPlacement in resume.components_placements" :key="componentPlacement.id" :componentPlacement="componentPlacement" @click="emit('selected-component-change', componentPlacement)" />
        </div>
    </div>
</template>
