mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 10:30:17 +01:00
intégration de l'analyse des avis dans l'interface admin
This commit is contained in:
@@ -8,7 +8,12 @@ export default function AvisList({ avis }) {
|
||||
function handleClick(id) {
|
||||
router.push(`/avis/${id}`);
|
||||
}
|
||||
|
||||
function truncateComment(text) {
|
||||
if(text.length > 100) {
|
||||
return text.substring(0, 100) + "..."
|
||||
}
|
||||
return text;
|
||||
}
|
||||
return (
|
||||
<Table>
|
||||
<thead>
|
||||
@@ -16,15 +21,17 @@ export default function AvisList({ avis }) {
|
||||
<th>Date</th>
|
||||
<th>Note globale</th>
|
||||
<th>Commentaire</th>
|
||||
<th>Positivité</th>
|
||||
<th>Source</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{avis.map(({ id, note_principale, commentaire, date, nom_source }) => {
|
||||
{avis.map(({ id, note_principale, commentaire,analyse, date, nom_source }) => {
|
||||
return <tr onClick={() => handleClick(id)} key={id} className={styles.row}>
|
||||
<td>{date}</td>
|
||||
<td>{note_principale} / 10</td>
|
||||
<td>{commentaire}</td>
|
||||
<td>{truncateComment(commentaire)}</td>
|
||||
<td>{analyse}</td>
|
||||
<td>{nom_source}</td>
|
||||
</tr>
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user