aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings/recipes/RecipeItem.js
diff options
context:
space:
mode:
authorLibravatar Nathanaƫl Houn <contact@nathanaelhoun.fr>2022-05-15 23:42:36 +0200
committerLibravatar GitHub <noreply@github.com>2022-05-15 23:42:36 +0200
commited2e034b12b15c5b4ac638e6b89a4ee9a7ed5012 (patch)
treee51d99224a111a02e9ce0f39ea9762387be2950a /src/components/settings/recipes/RecipeItem.js
parentExtracted ImageHelper and ImageController from ServiceController for reuse (diff)
downloadferdium-app-ed2e034b12b15c5b4ac638e6b89a4ee9a7ed5012.tar.gz
ferdium-app-ed2e034b12b15c5b4ac638e6b89a4ee9a7ed5012.tar.zst
ferdium-app-ed2e034b12b15c5b4ac638e6b89a4ee9a7ed5012.zip
fix: revert "Typescript conversion" (#153)
Diffstat (limited to 'src/components/settings/recipes/RecipeItem.js')
-rw-r--r--src/components/settings/recipes/RecipeItem.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/components/settings/recipes/RecipeItem.js b/src/components/settings/recipes/RecipeItem.js
new file mode 100644
index 000000000..df5b42222
--- /dev/null
+++ b/src/components/settings/recipes/RecipeItem.js
@@ -0,0 +1,33 @@
1import { Component } from 'react';
2import PropTypes from 'prop-types';
3import { observer } from 'mobx-react';
4
5import RecipePreviewModel from '../../../models/RecipePreview';
6
7class RecipeItem extends Component {
8 static propTypes = {
9 recipe: PropTypes.instanceOf(RecipePreviewModel).isRequired,
10 onClick: PropTypes.func.isRequired,
11 };
12
13 render() {
14 const { recipe, onClick } = this.props;
15
16 return (
17 <button type="button" className="recipe-teaser" onClick={onClick}>
18 {recipe.isDevRecipe && (
19 <span className="recipe-teaser__dev-badge">dev</span>
20 )}
21 <img src={recipe.icons.svg} className="recipe-teaser__icon" alt="" />
22 <span className="recipe-teaser__label">{recipe.name}</span>
23 {recipe.aliases && recipe.aliases.length > 0 && (
24 <span className="recipe-teaser__alias_label">
25 {`Aliases: ${recipe.aliases.join(', ')}`}
26 </span>
27 )}
28 </button>
29 );
30 }
31}
32
33export default observer(RecipeItem);