<template>
  <Tooltip placement="top">
    <template #title>
      <span>{{ t('component.table.showFormSearchConfig') }}</span>
    </template>
    <SearchOutlined @click="toggle" />
  </Tooltip>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { Tooltip } from 'ant-design-vue';
  import { SearchOutlined } from '@ant-design/icons-vue';

  import { useI18n } from '/@/hooks/web/useI18n';
  import { useTableContext } from '../../hooks/useTableContext';

  export default defineComponent({
    name: 'ShowFormSearch',
    components: {
      SearchOutlined,
      Tooltip,
    },
    setup() {
      const table = useTableContext();
      const { t } = useI18n();

      function toggle() {
        console.log('------------');
        console.log(`table`, table);
        table.showTableSearch();
      }

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