• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

EcrituresNumeriques / stylo / 14090633575

26 Mar 2025 06:19PM UTC coverage: 31.811% (+0.01%) from 31.801%
14090633575

push

github

web-flow
chore: remplace feather par lucide (plus d'icĂ´nes) (#1374)

470 of 703 branches covered (66.86%)

Branch coverage included in aggregate %.

4 of 47 new or added lines in 46 files covered. (8.51%)

2 existing lines in 1 file now uncovered.

4483 of 14867 relevant lines covered (30.15%)

2.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/front/src/components/Write/ReferenceList.jsx
1
import React, { useCallback, useState } from 'react'
×
2
import { shallowEqual, useSelector } from 'react-redux'
×
NEW
3
import { Search } from 'lucide-react'
×
4
import { useTranslation } from 'react-i18next'
×
5

6
import Reference from './Reference'
×
7
import styles from './ReferenceList.module.scss'
×
8
import Field from '../Field'
×
9
import Button from '../Button'
×
10

11
export default function ReferenceList() {
×
12
  const bibliographyEntries = useSelector(
×
13
    (state) => state.workingArticle.bibliography.entries,
×
14
    shallowEqual
×
15
  )
×
16
  const [filter, setFilter] = useState('')
×
17
  const [showAll, setShowAll] = useState(false)
×
18
  let bibTeXFound
×
19
  if (filter) {
×
20
    bibTeXFound = bibliographyEntries.filter(
×
21
      (entry) => entry.key.toLowerCase().indexOf(filter.toLowerCase()) > -1
×
22
    )
×
23
  } else {
×
24
    if (showAll) {
×
25
      bibTeXFound = bibliographyEntries
×
26
    } else {
×
27
      bibTeXFound = bibliographyEntries.slice(0, 25)
×
28
    }
×
29
  }
×
30
  const handleShowAll = useCallback(() => setShowAll(true), [])
×
31
  const { t } = useTranslation()
×
32
  return (
×
33
    <>
×
34
      <Field
×
35
        className={styles.searchField}
×
36
        type="text"
×
37
        icon={Search}
×
38
        value={filter}
×
39
        placeholder={t('write.searchFieldBiblio.placeholder')}
×
40
        onChange={(e) => setFilter(e.target.value)}
×
41
      />
×
42
      {filter && (
×
43
        <span className={styles.resultFoundCount}>
×
44
          {bibTeXFound.length} found
×
45
        </span>
×
46
      )}
47
      {bibTeXFound.map((entry, index) => (
×
48
        <Reference key={`ref-${entry.key}-${index}`} entry={entry} />
×
49
      ))}
×
50
      {!showAll && bibliographyEntries.length > 25 && (
×
51
        <Button className={styles.showAll} onClick={handleShowAll}>
×
52
          {t('write.showBiblio.button', { length: bibliographyEntries.length })}
×
53
        </Button>
×
54
      )}
55
    </>
×
56
  )
57
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc