refactor: standardize quotation marks in pnpm-lock.yaml and improve code formatting across various components; enhance readability and maintain consistency in code style

This commit is contained in:
Julien Froidefond
2025-12-23 11:42:02 +01:00
parent 01c1f25de2
commit c57daa9cc8
42 changed files with 4722 additions and 2758 deletions

View File

@@ -7,7 +7,7 @@ import { useState } from "react";
*/
export function useLocalStorage<T>(
key: string,
initialValue: T
initialValue: T,
): [T, (value: T | ((val: T) => T)) => void] {
// État pour stocker la valeur
const [storedValue, setStoredValue] = useState<T>(() => {
@@ -29,9 +29,9 @@ export function useLocalStorage<T>(
// Permet d'utiliser une fonction comme setState
const valueToStore =
value instanceof Function ? value(storedValue) : value;
setStoredValue(valueToStore);
if (typeof window !== "undefined") {
window.localStorage.setItem(key, JSON.stringify(valueToStore));
}
@@ -42,4 +42,3 @@ export function useLocalStorage<T>(
return [storedValue, setValue];
}