(ref: React.Ref<T> | undefined, value: T | null)
| 40 | } |
| 41 | |
| 42 | function assignRef<T>(ref: React.Ref<T> | undefined, value: T | null) { |
| 43 | if (!ref) return; |
| 44 | if (typeof ref === "function") { |
| 45 | ref(value); |
| 46 | return; |
| 47 | } |
| 48 | (ref as React.MutableRefObject<T | null>).current = value; |
| 49 | } |
| 50 | |
| 51 | type SortOrder = "sections" | "volume" | "impact" | "change" | "new"; |
| 52 | const CATEGORIES: Category[] = ["Politics", "Crypto", "Sports", "Finance", "Tech", "Culture", "Other"]; |