import type { IApi, IDumiTechStack } from '@/types';

export class ExportedReactTechStack implements IDumiTechStack {
  name = 'exported-react';

  runtimeOpts = {};

  isSupported() {
    return true;
  }

  transformCode(raw: string) {
    return raw;
  }

  generatePreviewerProps(props: any) {
    props.description = 'generated by exported tech stack';
    return props;
  }
}

export default function exportedTechStackPlugin(api: IApi) {
  api.registerTechStack(() => new ExportedReactTechStack());
}
