diff options
Diffstat (limited to 'src/components/settings/recipes/RecipeItem.tsx')
-rw-r--r-- | src/components/settings/recipes/RecipeItem.tsx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/components/settings/recipes/RecipeItem.tsx b/src/components/settings/recipes/RecipeItem.tsx new file mode 100644 index 000000000..1dfe88683 --- /dev/null +++ b/src/components/settings/recipes/RecipeItem.tsx | |||
@@ -0,0 +1,32 @@ | |||
1 | import { Component } from 'react'; | ||
2 | import { observer } from 'mobx-react'; | ||
3 | |||
4 | import RecipePreviewModel from '../../../models/RecipePreview'; | ||
5 | |||
6 | type Props = { | ||
7 | recipe: RecipePreviewModel; | ||
8 | onClick: () => {}; | ||
9 | }; | ||
10 | |||
11 | class RecipeItem extends Component<Props> { | ||
12 | render() { | ||
13 | const { recipe, onClick } = this.props; | ||
14 | |||
15 | return ( | ||
16 | <button type="button" className="recipe-teaser" onClick={onClick}> | ||
17 | {recipe.isDevRecipe && ( | ||
18 | <span className="recipe-teaser__dev-badge">dev</span> | ||
19 | )} | ||
20 | <img src={recipe.icon} className="recipe-teaser__icon" alt="" /> | ||
21 | <span className="recipe-teaser__label">{recipe.name}</span> | ||
22 | {recipe.aliases && recipe.aliases.length > 0 && ( | ||
23 | <span className="recipe-teaser__alias_label"> | ||
24 | {`Aliases: ${recipe.aliases.join(', ')}`} | ||
25 | </span> | ||
26 | )} | ||
27 | </button> | ||
28 | ); | ||
29 | } | ||
30 | } | ||
31 | |||
32 | export default observer(RecipeItem); | ||