<template>
  <DesktopLayout class="preview-box">
    <template #head>
      <DesignHead :title="t('设计预览')">
        <template #buttons>
          <div class="design-button">
            <a-button type="primary" class="clean-icon" @click="$emit('close')">{{
              t('关闭')
            }}</a-button>
          </div></template
        >
      </DesignHead>
    </template>
    <DesktopHome :list="props.list" :isMenu="false" :background="background" />
  </DesktopLayout>
</template>

<script setup lang="ts">
  import DesktopHome from './DesktopHome.vue';
  import { DesktopLayout, DesignHead } from '/@/components/Desktop';
  import { BackgroundSetting, DesktopInfoItem } from '/@/model/desktop/designer';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { backgroundInfo } from './designer/config/info';
  const { t } = useI18n();
  defineEmits(['close']);
  let props = withDefaults(
    defineProps<{
      list: Array<DesktopInfoItem>;
      background: BackgroundSetting;
    }>(),
    {
      list: () => {
        return [];
      },
      background: () => {
        return backgroundInfo;
      },
    },
  );
</script>

<style lang="less" scoped>
  :deep(.layout) {
    padding: 0;
  }
</style>
