<template>
  <div class="h-full bg-white">
    <fs-crud ref="crudRef" v-bind="crudBinding" />
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';
import { useFs } from '@fast-crud/fast-crud';
import createCrudOptions from './crud';
const props = defineProps({
  subjectId: {
    type: Number,
    default: 0
  }
});
interface Emits {
  (e: 'closeEmits', value: boolean): void;
}

const emits = defineEmits<Emits>();
const context = {
  subjectId: props.subjectId,
  viewActiveCloseFunc: () => {
    emits('closeEmits', true);
  }
};
const { crudRef, crudBinding, crudExpose } = useFs({ createCrudOptions, context });
onMounted(() => {
  crudExpose.doRefresh();
});
</script>

<style scoped lang="scss">
:deep(.fs-search-col) {
  margin-left: 2rem !important;
}
</style>
