mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-15 04:40:40 -07:00
Catches format drift that accumulated across 13 authored files in app/src and docs/. Auto-generated artifacts (tauri/src-tauri/gen, docs/openapi.json, docs/cli.json, app/src/lib/api) were left alone since the build regenerates them on each run — baking their formatted state into git just causes churn next build. No behavioral changes. Trailing commas, line wrapping, and indentation only. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
22 lines
644 B
TypeScript
22 lines
644 B
TypeScript
import { createContext, useContext, type ReactNode } from 'react';
|
|
import type { Platform } from './types';
|
|
|
|
const PlatformContext = createContext<Platform | null>(null);
|
|
|
|
export interface PlatformProviderProps {
|
|
platform: Platform;
|
|
children: ReactNode;
|
|
}
|
|
|
|
export function PlatformProvider({ platform, children }: PlatformProviderProps) {
|
|
return <PlatformContext.Provider value={platform}>{children}</PlatformContext.Provider>;
|
|
}
|
|
|
|
export function usePlatform(): Platform {
|
|
const platform = useContext(PlatformContext);
|
|
if (!platform) {
|
|
throw new Error('usePlatform must be used within PlatformProvider');
|
|
}
|
|
return platform;
|
|
}
|