import { MultiSwitch } from 'insomnia-components'; import React, { FunctionComponent } from 'react'; import type { GlobalActivity } from '../../common/constants'; import { ACTIVITY_DEBUG, ACTIVITY_SPEC, ACTIVITY_UNIT_TEST } from '../../common/constants'; import type { Workspace } from '../../models/workspace'; interface Props { activity: GlobalActivity; handleActivityChange: (options: {workspaceId?: string; nextActivity: GlobalActivity}) => Promise; workspace: Workspace; } export const ActivityToggle: FunctionComponent = ({ activity, handleActivityChange, workspace }) => { const choices = [ { label: 'Design', value: ACTIVITY_SPEC, }, { label: 'Debug', value: ACTIVITY_DEBUG, }, { label: 'Test', value: ACTIVITY_UNIT_TEST, }, ]; return ( handleActivityChange({ workspaceId: workspace._id, nextActivity })} choices={choices} selectedValue={activity} /> ); };