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

EcrituresNumeriques / stylo / 14474025727

15 Apr 2025 04:01PM UTC coverage: 33.414% (-0.008%) from 33.422%
14474025727

Pull #1424

github

web-flow
Merge 6f33a8bea into c70187793
Pull Request #1424: chore: remplace quelques usages de Geist

515 of 775 branches covered (66.45%)

Branch coverage included in aggregate %.

0 of 27 new or added lines in 6 files covered. (0.0%)

56 existing lines in 6 files now uncovered.

5020 of 15790 relevant lines covered (31.79%)

2.3 hits per line

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

0.0
/front/src/components/workspace/WorkspaceItem.jsx
1
import React from 'react'
×
NEW
2
import { CircleOff, Slash, Users } from 'lucide-react'
×
3
import { useTranslation } from 'react-i18next'
×
4

5
import { useModal } from '../../hooks/modal.js'
×
6
import Button from '../Button.jsx'
×
7
import Field from '../Field.jsx'
×
8

9
import TimeAgo from '../TimeAgo.jsx'
×
10
import LeaveWorkspaceModal from './LeaveWorkspaceModal.jsx'
×
11

12
import styles from './workspaceItem.module.scss'
×
13
import WorkspaceManageMembersModal from './WorkspaceManageMembersModal.jsx'
×
14

15
/**
16
 * @typedef {Object} WorkspaceItemProps
17
 * @property {{
18
 *   color: string,
19
 *   name: string,
20
 *   description: string,
21
 *   personal: boolean,
22
 *   articlesCount: number,
23
 *   creator: {
24
 *     displayName: string,
25
 *     username: string
26
 *   },
27
 *   createdAt: string,
28
 *   updatedAt: string
29
 * }} workspace
30
 */
31

32
/**
33
 * @param {WorkspaceItemProps} props
34
 * @returns {React.ReactHTMLElement}
35
 */
36
export default function WorkspaceItem({ workspace }) {
×
37
  const { t } = useTranslation()
×
38
  const workspaceLeaveModal = useModal()
×
39
  const workspaceManageMembersModal = useModal()
×
40

41
  const workspaceTitle = (
×
42
    <>
×
43
      <h5 className={styles.title}>
×
44
        <span
×
45
          className={styles.chip}
×
46
          style={{ backgroundColor: workspace.color }}
×
47
        ></span>
×
48
        <span>{workspace.name}</span>
×
49
      </h5>
×
50
    </>
×
51
  )
52

53
  return (
×
54
    <div className={styles.container}>
×
55
      {workspaceTitle}
×
56
      {workspace.personal && (
×
57
        <>
×
58
          <Field className={styles.field} label="Articles">
×
59
            <span>{workspace.articlesCount}</span>
×
60
          </Field>
×
61
        </>
×
62
      )}
63
      {!workspace.personal && (
×
64
        <>
×
65
          <div>
×
66
            {workspace.description && (
×
67
              <Field
×
68
                className={styles.field}
×
69
                label={t('workspace.description.label')}
×
70
              >
71
                <span>{workspace.description}</span>
×
72
              </Field>
×
73
            )}
74
            <Field
×
75
              className={styles.field}
×
76
              label={t('workspace.createdAt.label')}
×
77
            >
78
              <>
×
79
                <TimeAgo date={workspace.createdAt} />
×
80
                {workspace.creator && (
×
81
                  <>
×
82
                    {' '}
×
83
                    <span>{t('workspace.createdBy.label')}</span>{' '}
×
84
                    <span className={styles.creator}>
×
85
                      {workspace.creator.displayName ||
×
86
                        workspace.creator.username}
×
87
                    </span>
×
88
                  </>
×
89
                )}
90
              </>
×
91
            </Field>
×
92
            <Field
×
93
              className={styles.field}
×
94
              label={t('workspace.updatedAt.label')}
×
95
            >
96
              <TimeAgo date={workspace.updatedAt} />
×
97
            </Field>
×
98
            <Field
×
99
              className={styles.field}
×
100
              label={t('workspace.membersCount.label')}
×
101
            >
102
              <span>{workspace.stats.membersCount}</span>
×
103
            </Field>
×
104
            <Field
×
105
              className={styles.field}
×
106
              label={t('workspace.articlesCount.label')}
×
107
            >
108
              <span>{workspace.stats.articlesCount}</span>
×
109
            </Field>
×
110
          </div>
×
111
          <aside className={styles.actionButtons}>
×
112
            <Button
×
113
              title={t('workspace.manageMember.title')}
×
114
              onClick={() => workspaceManageMembersModal.show()}
×
115
            >
116
              <Users /> {t('workspace.manageMember.button')}
×
117
            </Button>
×
118
            <Button
×
119
              title={t('workspace.leave.title')}
×
120
              onClick={() => workspaceLeaveModal.show()}
×
121
            >
NEW
122
              <CircleOff /> {t('workspace.leave.button')}
×
123
            </Button>
×
124
          </aside>
×
125

126
          <LeaveWorkspaceModal {...workspaceLeaveModal} workspace={workspace} />
×
127

128
          <WorkspaceManageMembersModal
×
129
            {...workspaceManageMembersModal}
×
130
            workspace={workspace}
×
131
          />
×
132
        </>
×
133
      )}
134
    </div>
×
135
  )
136
}
×
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