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

EcrituresNumeriques / stylo / 12925854411

23 Jan 2025 09:11AM UTC coverage: 25.831% (-4.7%) from 30.523%
12925854411

push

github

web-flow
Merge pull request #1192 from EcrituresNumeriques/feat/vite6

322 of 518 branches covered (62.16%)

Branch coverage included in aggregate %.

3448 of 14077 relevant lines covered (24.49%)

1.66 hits per line

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

0.0
/front/src/components/ArticleSendCopy.jsx
1
import React, { useCallback } from 'react'
×
2

3
import { useToasts } from '@geist-ui/core'
×
4
import { Send } from 'react-feather'
×
5
import { useTranslation } from 'react-i18next'
×
6

7
import { duplicateArticle } from './Article.graphql'
×
8

9
import styles from './articleSendCopy.module.scss'
×
10
import ContactSearch from './ContactSearch.jsx'
×
11
import { useMutation } from '../hooks/graphql.js'
×
12

13
export default function ArticleSendCopy({ article }) {
×
14
  const { setToast } = useToasts()
×
15
  const mutation = useMutation()
×
16
  const { t } = useTranslation()
×
17

18
  const handleUserUpdated = useCallback(
×
19
    async ({ user, action }) => {
×
20
      if (action === 'select' || action === 'unselect') {
×
21
        try {
×
22
          await mutation({
×
23
            query: duplicateArticle,
×
24
            variables: { user: null, to: user._id, article: article._id },
×
25
          })
×
26
          setToast({
×
27
            text: t('article.sendCopy.successNotification', {
×
28
              username: user.displayName || user.username,
×
29
            }),
×
30
            type: 'success',
×
31
          })
×
32
        } catch (err) {
×
33
          setToast({
×
34
            type: 'error',
×
35
            text: t('article.sendCopy.errorNotification', {
×
36
              errMessage: err.message,
×
37
            }),
×
38
          })
×
39
        }
×
40
      }
×
41
    },
×
42
    [article._id]
×
43
  )
×
44

45
  return (
×
46
    <section className={styles.acquintances}>
×
47
      <ContactSearch
×
48
        selectedIcon={<Send />}
×
49
        unselectedIcon={<Send />}
×
50
        onUserUpdated={handleUserUpdated}
×
51
        members={[]}
×
52
      />
×
53
    </section>
×
54
  )
55
}
×
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