Untitled

mail@pastecode.io avatar
unknown
jsx
2 years ago
1.1 kB
3
Indexable
Never
 {filteredChar === "All" ? (
              alphabetWithoutAll.map((letter, index) => (
                <div className={styles.results_item} key={index}>
                  <span className={styles.letter}>{letter}</span>
                  <div className={styles.result}>
                    <ul>
                      {stores
                        .filter((store) => store?.title.includes(letter))
                        .map((result) => (
                          <li>{result?.title}</li>
                        ))}
                    </ul>
                  </div>
                </div>
              ))
            ) : (
              <div className={styles.results_item}>
                <span className={styles.letter}>{filteredChar}</span>
                <div className={styles.result}>
                  <ul>
                    {stores
                      .filter((store) => store?.title.includes(filteredChar))
                      .map((result) => (
                        <li>{result?.title}</li>
                      ))}
                  </ul>
                </div>
              </div>
            )}