()
| 2 | import { DashboardContext, type DashboardValue } from "./DashboardProvider"; |
| 3 | |
| 4 | export const useDashboard = (): DashboardValue => { |
| 5 | const context = useContext(DashboardContext); |
| 6 | |
| 7 | if (!context) { |
| 8 | throw new Error( |
| 9 | "useDashboard only can be used inside of DashboardProvider", |
| 10 | ); |
| 11 | } |
| 12 | |
| 13 | return context; |
| 14 | }; |
| 15 | |
| 16 | export const getDefaultOrganizationName = ( |
| 17 | organizations: DashboardValue["organizations"], |
no outgoing calls
no test coverage detected