title: How to use ternary operator to display some text instead of using if else conditions in react and typescript?
body: <p>i have code like below,</p>
  <pre><code>if (filteredIds.length &gt; 0) {
      notify({
          title: `${
              type === &quot;type1&quot;
                  ? 'type1 checks'
                  : 'type2 checks'
          } started.`,
      });
   } else {
       notify({
           title: `${
               type === &quot;type1&quot;
                   ? 'type1 checks'
                   : 'type2 checks'
           } have been already running on selected id.`,
       });
   }
  </code></pre>
  <p>the above code works. But i want to use ternary operator to be used instead of if and else as  the notify thing seems to be repetitive.</p>
  <p>i want something like having the ternary operator in notify itself to return necessary text based on filteredIds length and type.</p>
  <pre><code>notify({
      title: `${ //condition here
          type === &quot;type1&quot; 
              ? 'type1 checks'
              : 'type2 checks'
      } started.`,
  });
  </code></pre>
  <p>Basically i want the if else code to be less code. Could someone help me with this. I am new to programming and not sure how to use nested ternary operator.
  thanks.</p>