<template>
  <Transition name="workbench-mode-fade" mode="out-in" appear>
    <PersonalWorkbenchAiMode
      v-if="workbenchMode === 'ai'"
      key="ai"
      :sidebar-command="aiSidebarCommand"
      @conversation-change="emit('ai-conversation-change', $event)"
      @conversation-history-change="emit('ai-conversation-history-change', $event)"
      @open-document="emit('open-document', $event)"
      @request-updated="emit('request-updated', $event)"
    />
    <PersonalWorkbench
      v-else
      key="traditional"
      :show-header="false"
      :assistant-modal-open="assistantModalOpen"
      :workbench-summary="workbenchSummary"
      @open-assistant="emit('open-assistant', $event)"
      @open-document="emit('open-document', $event)"
    />
  </Transition>
</template>

<script setup>
import PersonalWorkbenchAiMode from '../components/business/PersonalWorkbenchAiMode.vue'
import PersonalWorkbench from '../components/business/PersonalWorkbench.vue'

defineProps({
  assistantModalOpen: { type: Boolean, default: false },
  workbenchSummary: { type: Object, default: () => ({}) },
  workbenchMode: { type: String, default: 'traditional' },
  aiSidebarCommand: { type: Object, default: () => ({ seq: 0, type: '', payload: null }) }
})

const emit = defineEmits(['open-assistant', 'open-document', 'ai-conversation-change', 'ai-conversation-history-change', 'request-updated'])
</script>

<style scoped src="../assets/styles/views/personal-workbench-view.css"></style>
