import { isNil } from 'lodash';
import { computed } from 'vue';
import { useRoute } from 'vue-router';

export function useIdProducto() {
  const route = useRoute();
  const id = computed(() => {
    const _id = route.params.ID_PRODUCTO;
    return isNil(_id) ? null : Number(_id);
  });

  return { id };
}
