import type { App, Plugin } from 'vue';
import { useFeatureFlipper } from '@/plugins/feature-flipper/featureFlipper.composable';
import { FeatureFlipperFeatures } from './featureFlipper.model';
import FeatureFlipper from './FeatureFlipper.vue';

export const featureFlipperPlugin: Plugin = {
  install: (app: App, initialFeatures: FeatureFlipperFeatures) => {
    const { initFeatures } = useFeatureFlipper();
    initFeatures(initialFeatures);
    app.component('BmsFeatureFlipper', FeatureFlipper);
    app.component('bms-feature-flipper', FeatureFlipper);
  },
};

export * from './featureFlipper.composable';
export * from './featureFlipper.model';
