From 81c43ecc3d17e0dbf7ad1d949b6d977f2c65bd48 Mon Sep 17 00:00:00 2001
From: muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com>
Date: Thu, 27 Oct 2022 07:13:47 +0530
Subject: fix: 'failed prop' warning in QuickSwitchModal, SettingsNavigation,
 SettingsWindow and Recipe component tree (#713)

* chore: turn off eslint rule @typescript-eslint/no-useless-constructor to initialize dynamic props & state

Co-authored-by: Muhamed <>
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
---
 src/components/settings/recipes/RecipeItem.tsx | 36 ++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/components/settings/recipes/RecipeItem.tsx

(limited to 'src/components/settings/recipes/RecipeItem.tsx')

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 @@
+import { Component, MouseEventHandler } from 'react';
+import { observer } from 'mobx-react';
+import RecipePreview from '../../../models/RecipePreview';
+
+interface IProps {
+  recipe: RecipePreview;
+  onClick: MouseEventHandler<HTMLButtonElement>;
+}
+
+@observer
+class RecipeItem extends Component<IProps> {
+  constructor(props: IProps) {
+    super(props);
+  }
+
+  render() {
+    const { recipe, onClick } = this.props;
+
+    return (
+      <button type="button" className="recipe-teaser" onClick={onClick}>
+        {recipe.isDevRecipe && (
+          <span className="recipe-teaser__dev-badge">dev</span>
+        )}
+        <img src={recipe.icons?.svg} className="recipe-teaser__icon" alt="" />
+        <span className="recipe-teaser__label">{recipe.name}</span>
+        {recipe.aliases && recipe.aliases.length > 0 && (
+          <span className="recipe-teaser__alias_label">
+            {`Aliases: ${recipe.aliases.join(', ')}`}
+          </span>
+        )}
+      </button>
+    );
+  }
+}
+
+export default RecipeItem;
-- 
cgit v1.2.3-70-g09d2

