Create useEntityHistory.ts with parameterized entity type. Rewrite useComponentHistory, usePieceHistory, useProductHistory as thin backward-compatible wrappers (67→13 LOC each). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
13 lines
405 B
TypeScript
13 lines
405 B
TypeScript
/**
|
|
* Backward-compatible wrapper around useEntityHistory.
|
|
* Real logic lives in useEntityHistory.ts.
|
|
*/
|
|
import { useEntityHistory, type EntityHistoryActor, type EntityHistoryEntry } from './useEntityHistory'
|
|
|
|
export type ComponentHistoryActor = EntityHistoryActor
|
|
export type ComponentHistoryEntry = EntityHistoryEntry
|
|
|
|
export function useComponentHistory() {
|
|
return useEntityHistory('composant')
|
|
}
|