test(reporting): more reporting tables for different reports

This commit is contained in:
2025-04-13 08:27:28 -05:00
parent 17b6c0ac66
commit 9325e58551
17 changed files with 434 additions and 122 deletions

View File

@@ -0,0 +1,55 @@
import { create } from "zustand";
import { devtools, persist } from "zustand/middleware";
interface CardSettings {
daysSinceLast?: number;
rowType?: string;
}
export interface Card {
i: string;
x: number;
y: number;
w: number;
h: number;
minW?: number;
maxW?: number;
minH?: number;
maxH?: number;
isResizable: boolean;
isDraggable: boolean;
cardSettings?: CardSettings;
}
interface CardStore {
cards: Card[]; // Array of card objects
addCard: (card: Card) => void;
updateCard: (id: string, updatedCard: Partial<Card>) => void;
removeCard: (id: string) => void;
}
export const useCardStore = create<CardStore>()(
devtools(
persist<CardStore>(
(set) => ({
cards: [],
addCard: (card) =>
set((state) => ({ cards: [...state.cards, card] })),
updateCard: (id, updatedCard) =>
set((state) => ({
cards: state.cards.map((card) =>
card.i === id ? { ...card, ...updatedCard } : card
),
})),
removeCard: (id) =>
set((state) => ({
cards: state.cards.filter((card) => card.i !== id),
})),
}),
{ name: "card-storage" }
)
)
);