-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat : setup a router to better manage multiple plugin
- Loading branch information
1 parent
450f574
commit c7b5dbe
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} | ||
} | ||
|