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
389 B
TypeScript
13 lines
389 B
TypeScript
/**
|
|
* Backward-compatible wrapper around useEntityHistory.
|
|
* Real logic lives in useEntityHistory.ts.
|
|
*/
|
|
import { useEntityHistory, type EntityHistoryActor, type EntityHistoryEntry } from './useEntityHistory'
|
|
|
|
export type PieceHistoryActor = EntityHistoryActor
|
|
export type PieceHistoryEntry = EntityHistoryEntry
|
|
|
|
export function usePieceHistory() {
|
|
return useEntityHistory('piece')
|
|
}
|