| 1 |
import { Generic } from '@agent/workflows/abilities/components/run/Generic'; |
| 2 |
import { CreateProduct } from '@agent/workflows/abilities/components/run/woo/CreateProduct'; |
| 3 |
import { createElement } from '@wordpress/element'; |
| 4 |
|
| 5 |
const BY_ABILITY = { |
| 6 |
'woocommerce/product-create': CreateProduct, |
| 7 |
}; |
| 8 |
|
| 9 |
export const hasRunComponent = (abilityName) => !!BY_ABILITY[abilityName]; |
| 10 |
|
| 11 |
export const AbilityRun = (props) => |
| 12 |
createElement(BY_ABILITY[props.id] ?? Generic, props); |
| 13 |
|