'use client'; import * as React from 'react'; import type { SwitchRootState } from './SwitchRoot'; export type SwitchRootContext = SwitchRootState; export const SwitchRootContext = React.createContext(undefined); export function useSwitchRootContext() { const context = React.useContext(SwitchRootContext); if (context === undefined) { throw new Error( 'Zest: SwitchRootContext is missing. Switch parts must be placed within .', ); } return context; }