aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings/recipes/RecipeItem.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/settings/recipes/RecipeItem.tsx')
-rw-r--r--src/components/settings/recipes/RecipeItem.tsx36
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 @@
1import { Component, MouseEventHandler } from 'react';
2import { observer } from 'mobx-react';
3import RecipePreview from '../../../models/RecipePreview';
4
5interface IProps {
6 recipe: RecipePreview;
7 onClick: MouseEventHandler<HTMLButtonElement>;
8}
9
10@observer
11class 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
36export default RecipeItem;