@@ -15,6 +15,7 @@ import {
1515 alternativeOperatorSkillUsages ,
1616 getDefaultRequirements ,
1717 getEliteIconUrl ,
18+ getModuleName ,
1819 getSkillCount ,
1920 getSkillUsageAltTitle ,
2021 useLocalizedOperatorName ,
@@ -429,31 +430,54 @@ export const OperatorItem: FC<OperatorItemProps> = memo(
429430 < Select
430431 className = "row-start-4"
431432 filterable = { false }
432- items = { info . modules }
433+ items = { [
434+ CopilotDocV1 . Module . Default ,
435+ ...info . modules
436+ . map ( ( m ) =>
437+ m
438+ ? ( CopilotDocV1 . Module [ m ] as
439+ | CopilotDocV1 . Module
440+ | undefined )
441+ : CopilotDocV1 . Module . Original ,
442+ )
443+ . filter ( ( m ) => m !== undefined ) ,
444+ ] }
433445 itemRenderer = { (
434- item ,
435- { index , handleClick, handleFocus, modifiers } ,
446+ value ,
447+ { handleClick, handleFocus, modifiers } ,
436448 ) => (
437449 < MenuItem
438450 roleStructure = "listoption"
439- key = { item }
451+ key = { value }
440452 className = { clsx (
441453 'min-w-12 !rounded-none text-base font-serif font-bold text-center text-slate-600 dark:text-slate-300' ,
442454 modifiers . active && Classes . ACTIVE ,
443455 ) }
444- text = { item || < Icon icon = "disable" /> }
456+ text = {
457+ value === CopilotDocV1 . Module . Default ? (
458+ < Icon icon = "disable" />
459+ ) : value === CopilotDocV1 . Module . Original ? (
460+ < Icon icon = "small-square" />
461+ ) : (
462+ getModuleName ( value )
463+ )
464+ }
465+ title = { t . components . editor2 . OperatorItem . module_title ( {
466+ count : value ,
467+ name : getModuleName ( value ) ,
468+ } ) }
445469 onClick = { handleClick }
446470 onFocus = { handleFocus }
447- selected = { index === requirements . module }
471+ selected = { value === requirements . module }
448472 />
449473 ) }
450- onItemSelect = { ( item ) => {
474+ onItemSelect = { ( value ) => {
451475 edit ( ( ) => {
452476 onChange ?.( {
453477 ...operator ,
454478 requirements : {
455479 ...operator . requirements ,
456- module : info . modules . indexOf ( item ) ,
480+ module : value ,
457481 } ,
458482 } )
459483 return {
@@ -472,15 +496,28 @@ export const OperatorItem: FC<OperatorItemProps> = memo(
472496 < Button
473497 small
474498 minimal
475- title = { t . components . editor2 . OperatorItem . module }
499+ title = {
500+ t . components . editor2 . OperatorItem . module +
501+ ': ' +
502+ t . components . editor2 . OperatorItem . module_title ( {
503+ count : requirements . module ,
504+ name : getModuleName ( requirements . module ) ,
505+ } )
506+ }
476507 className = { clsx (
477508 'w-4 h-4 !p-0 flex items-center justify-center font-serif !font-bold !text-base !rounded-none !border-2 !border-current' ,
478- requirements . module
509+ requirements . module !== CopilotDocV1 . Module . Default
479510 ? '!bg-purple-100 dark:!bg-purple-900 dark:!text-purple-200 !text-purple-800'
480511 : '!bg-gray-300 dark:!bg-gray-600 opacity-15 dark:opacity-25 hover:opacity-30 dark:hover:opacity-50' ,
481512 ) }
482513 >
483- { info . modules [ requirements . module ] }
514+ { requirements . module ===
515+ CopilotDocV1 . Module . Default ? null : requirements . module ===
516+ CopilotDocV1 . Module . Original ? (
517+ < Icon icon = "small-square" />
518+ ) : (
519+ getModuleName ( requirements . module )
520+ ) }
484521 </ Button >
485522 </ Select >
486523 ) }
0 commit comments