Portal/rsconcept/frontend/src/features/rsform/components/icon-dependency-mode.tsx

27 lines
983 B
TypeScript
Raw Normal View History

2025-02-26 00:16:22 +03:00
import {
type DomIconProps,
IconGraphCollapse,
IconGraphExpand,
IconGraphInputs,
IconGraphOutputs,
2025-07-25 16:02:23 +03:00
IconGraphSelection
2025-03-12 12:04:23 +03:00
} from '@/components/icons';
2025-02-26 00:16:22 +03:00
2025-03-12 11:54:32 +03:00
import { DependencyMode } from '../stores/cst-search';
2025-02-26 00:16:22 +03:00
/** Icon for term graph dependency mode. */
export function IconDependencyMode({ value, size = '1.25rem', className }: DomIconProps<DependencyMode>) {
switch (value) {
case DependencyMode.ALL:
2025-07-25 16:02:23 +03:00
return <IconGraphSelection size={size} className={className} />;
2025-02-26 00:16:22 +03:00
case DependencyMode.OUTPUTS:
2025-04-12 21:47:46 +03:00
return <IconGraphOutputs size={size} className={className ?? 'text-primary'} />;
2025-02-26 00:16:22 +03:00
case DependencyMode.INPUTS:
2025-04-12 21:47:46 +03:00
return <IconGraphInputs size={size} className={className ?? 'text-primary'} />;
2025-02-26 00:16:22 +03:00
case DependencyMode.EXPAND_OUTPUTS:
2025-04-12 21:47:46 +03:00
return <IconGraphExpand size={size} className={className ?? 'text-primary'} />;
2025-02-26 00:16:22 +03:00
case DependencyMode.EXPAND_INPUTS:
2025-04-12 21:47:46 +03:00
return <IconGraphCollapse size={size} className={className ?? 'text-primary'} />;
2025-02-26 00:16:22 +03:00
}
}