Skip to content

Commit

Permalink
✨ feat : setup a router to better manage multiple plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumefalvet committed May 25, 2024
1 parent 450f574 commit c7b5dbe
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions property-inspector/src/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { lazy } from 'react';
const IncrementAction = lazy(() => import('./actions/IncrementAction'));
const LightSwitchAction = lazy(() => import('./actions/LightSwitchAction'));

// - Types
import { ParsedProps } from './types/streamDeck';

// - Shared
import { INCREMENT_COUNTER_UUID, LIGHT_SWITCH_UUID } from 'shared';


export default function RouterAction(props: ParsedProps) {

switch (props.inActionInfo.action) {
case INCREMENT_COUNTER_UUID:
return <IncrementAction {...props} />
case LIGHT_SWITCH_UUID:
return <LightSwitchAction {...props} />
default:
return (
<div>
<img src="../../imgs/plugin/marketplace.png" alt="Unknown Action" />
</div>
);
}
}

0 comments on commit c7b5dbe

Please sign in to comment.