<template>
  <Tooltip placement="top">
    <template #title>
      <span>{{ t('刷新') }}</span>
    </template>
    <IconFontSymbol
      icon="shuaxintongbu"
      fontSize="16"
      fillColor="#C3C8CF"
      @click="redo"
      class="table-setting-icon"
    />
  </Tooltip>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { Tooltip } from 'ant-design-vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { useTableContext } from '../../hooks/useTableContext';
  import IconFontSymbol from '/@/components/IconFontSymbol/Index.vue';

  export default defineComponent({
    name: 'RedoSetting',
    components: {
      Tooltip,
      IconFontSymbol,
    },
    emits: ['redo'],
    setup(_, { emit }) {
      const table = useTableContext();
      const { t } = useI18n();

      function redo() {
        table.reload();
        emit('redo');
      }

      return { redo, t };
    },
  });
</script>
