diff options
Diffstat (limited to 'src/components/settings/recipes/RecipeItem.tsx')
-rw-r--r-- | src/components/settings/recipes/RecipeItem.tsx | 36 |
1 files changed, 36 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..432e4e6a1 --- /dev/null +++ b/src/components/settings/recipes/RecipeItem.tsx | |||
@@ -0,0 +1,36 @@ | |||
1 | import { Component, MouseEventHandler } from 'react'; | ||
2 | import { observer } from 'mobx-react'; | ||
3 | import RecipePreview from '../../../models/RecipePreview'; | ||
4 | |||
5 | interface IProps { | ||
6 | recipe: RecipePreview; | ||
7 | onClick: MouseEventHandler<HTMLButtonElement>; | ||
8 | } | ||
9 | |||
10 | @observer | ||
11 | class RecipeItem extends Component<IProps> { | ||
12 | constructor(props: IProps) { | ||
13 | super(props); | ||
14 | } | ||
15 | |||
16 | render() { | ||
17 | const { recipe, onClick } = this.props; | ||
18 | |||
19 | return ( | ||
20 | <button type="button" className="recipe-teaser" onClick={onClick}> | ||
21 | {recipe.isDevRecipe && ( | ||
22 | <span className="recipe-teaser__dev-badge">dev</span> | ||
23 | )} | ||
24 | <img src={recipe.icons?.svg} className="recipe-teaser__icon" alt="" /> | ||
25 | <span className="recipe-teaser__label">{recipe.name}</span> | ||
26 | {recipe.aliases && recipe.aliases.length > 0 && ( | ||
27 | <span className="recipe-teaser__alias_label"> | ||
28 | {`Aliases: ${recipe.aliases.join(', ')}`} | ||
29 | </span> | ||
30 | )} | ||
31 | </button> | ||
32 | ); | ||
33 | } | ||
34 | } | ||
35 | |||
36 | export default RecipeItem; | ||