🚨(demo) fix demo lint

Due to previous changes, let's fix the lint for this app.
This commit is contained in:
Nathan Vasse
2025-09-23 15:23:50 +02:00
committed by NathanVss
parent 33c5866c28
commit 587e782e61
3 changed files with 19 additions and 13 deletions

View File

@@ -7,7 +7,6 @@ import {
useToastProvider,
VariantType,
useModals,
defaultTokens,
} from "@openfun/cunningham-react";
import { PageProps } from "./App";
import { database } from "./Character";
@@ -43,14 +42,14 @@ export const Home = ({ modal }: { modal: PageProps }) => {
// Set the pagination length.
pagination.setPagesCount(
Math.ceil(sortedDatabase.length / pagination.pageSize)
Math.ceil(sortedDatabase.length / pagination.pageSize),
);
// Select the rows to display on the current page.
setRows(
sortedDatabase.slice(
(pagination.page - 1) * pagination.pageSize,
pagination.page * pagination.pageSize
)
pagination.page * pagination.pageSize,
),
);
setIsLoading(false);
}, [pagination.page, sortModel, modal.isOpen, refresh]);
@@ -138,13 +137,13 @@ export const Home = ({ modal }: { modal: PageProps }) => {
return;
}
const index = database.findIndex(
(character) => character.id === params.row.id
(character) => character.id === params.row.id,
);
database.splice(index, 1);
setRefresh(refresh + 1);
toast(
"Character deleted successfully",
VariantType.WARNING
VariantType.WARNING,
);
}}
icon={<span className="material-icons">delete</span>}