chore: finish frontend ESLint migration #18
Enable every plugin recommended preset and replace Biome with ESLint formatting. Preserve API contracts and JSX whitespace; verify source, tests, builds and tooling.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { useSearchParams } from "react-router";
|
||||
|
||||
import {
|
||||
bankPeriod,
|
||||
useBankCards,
|
||||
@@ -7,9 +8,10 @@ import {
|
||||
useBankSummary,
|
||||
} from "@/entities/bank-card";
|
||||
|
||||
type CardsPageVm = ReturnType<typeof useCardsPageVm>;
|
||||
function useCardsPageVm() {
|
||||
const [params, setParams] = useSearchParams();
|
||||
const period = bankPeriod(params);
|
||||
const [parameters, setParameters] = useSearchParams();
|
||||
const period = bankPeriod(parameters);
|
||||
const [archive, setArchive] = useState(false);
|
||||
const categories = useBankCategories();
|
||||
const [managingCategories, setManagingCategories] = useState(false);
|
||||
@@ -17,25 +19,24 @@ function useCardsPageVm() {
|
||||
const cards = useBankCards(archive);
|
||||
const summary = useBankSummary(period);
|
||||
return {
|
||||
categories,
|
||||
managingCategories,
|
||||
setManagingCategories,
|
||||
period,
|
||||
archive,
|
||||
setArchive,
|
||||
adding,
|
||||
setAdding,
|
||||
archive,
|
||||
cards,
|
||||
summary,
|
||||
setPeriod: (value: [string | null, string | null]) => {
|
||||
if (value[0] && value[1]) setParams({ from: value[0], to: value[1] });
|
||||
},
|
||||
items: cards.data?.map((card) => ({
|
||||
categories,
|
||||
items: cards.data?.map(card => ({
|
||||
...card,
|
||||
to: `/cards/${card.id}?${new URLSearchParams(period)}`,
|
||||
})),
|
||||
managingCategories,
|
||||
period,
|
||||
setAdding,
|
||||
setArchive,
|
||||
setManagingCategories,
|
||||
setPeriod: (value: [null | string, null | string]) => {
|
||||
if (value[0] && value[1]) setParameters({ from: value[0], to: value[1] });
|
||||
},
|
||||
summary,
|
||||
};
|
||||
}
|
||||
type CardsPageVm = ReturnType<typeof useCardsPageVm>;
|
||||
|
||||
export { type CardsPageVm, useCardsPageVm };
|
||||
|
||||
Reference in New Issue
Block a user