diff options
author | Nathanaƫl Houn <contact@nathanaelhoun.fr> | 2022-05-15 23:42:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-15 23:42:36 +0200 |
commit | ed2e034b12b15c5b4ac638e6b89a4ee9a7ed5012 (patch) | |
tree | e51d99224a111a02e9ce0f39ea9762387be2950a /src/components/settings/recipes/RecipeItem.js | |
parent | Extracted ImageHelper and ImageController from ServiceController for reuse (diff) | |
download | ferdium-app-ed2e034b12b15c5b4ac638e6b89a4ee9a7ed5012.tar.gz ferdium-app-ed2e034b12b15c5b4ac638e6b89a4ee9a7ed5012.tar.zst ferdium-app-ed2e034b12b15c5b4ac638e6b89a4ee9a7ed5012.zip |
fix: revert "Typescript conversion" (#153)
This reverts commit 8b1bfc356c3182c481394251f3ceeb902f2baec3.
Diffstat (limited to 'src/components/settings/recipes/RecipeItem.js')
-rw-r--r-- | src/components/settings/recipes/RecipeItem.js | 33 |
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 @@ | |||
1 | import { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | |||
5 | import RecipePreviewModel from '../../../models/RecipePreview'; | ||
6 | |||
7 | class 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 | |||
33 | export default observer(RecipeItem); | ||