export type ChartLibraryView = | { readonly kind: "list" } | { readonly kind: "self" } | { readonly kind: "other"; readonly id: string } | { readonly kind: "add" }; export const CHART_LIBRARY_LIST_VIEW: ChartLibraryView = { kind: "list" }; export function synastryHistoryForPartner(history: readonly T[], partner: { readonly id: string; readonly name: string }) { return history.filter((item) => ( item.partnerChartId ? item.partnerChartId === partner.id : item.partnerName === partner.name )); }