diff options
author | 2022-05-14 08:50:02 -0500 | |
---|---|---|
committer | 2022-05-14 08:50:02 -0500 | |
commit | 8b1bfc356c3182c481394251f3ceeb902f2baec3 (patch) | |
tree | 5beeee82ccc2981cf989bb9e192bc3c1f53f1ae9 /src/components/settings/recipes/RecipeItem.tsx | |
parent | 6.0.0-nightly.34 [skip ci] (diff) | |
download | ferdium-app-8b1bfc356c3182c481394251f3ceeb902f2baec3.tar.gz ferdium-app-8b1bfc356c3182c481394251f3ceeb902f2baec3.tar.zst ferdium-app-8b1bfc356c3182c481394251f3ceeb902f2baec3.zip |
Typescript conversion
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); | ||