Files
vercel__workflow/docs/components/worlds/WorldDataProvider.tsx
Nathan Rajlich 32ac8e73fd Fix Biome lint violations and add Biome CI check (#3222)
* Fix Biome lint violations and add Biome CI check

Biome was not configured to respect .gitignore, so ~92% of the 13,355
reported diagnostics came from gitignored build artifacts. Enable VCS
integration (useIgnoreFile), apply safe auto-fixes across the repo, fix
the remaining mechanical errors by hand, downgrade judgment-call a11y /
dangerouslySetInnerHTML rules to warnings, and add a 'biome ci' job to
the Lint workflow so violations block PRs going forward.

* Use an empty changeset (no behavior change, no release needed)
2026-07-30 22:32:12 +00:00

49 lines
993 B
TypeScript

'use client';
import { createContext, type ReactNode, useContext } from 'react';
import type { World } from './types';
interface WorldDataContextValue {
worldId: string;
world: World;
meta: {
lastUpdated: string;
commit: string | null;
branch: string | null;
};
}
const WorldDataContext = createContext<WorldDataContextValue | null>(null);
interface WorldDataProviderProps {
worldId: string;
world: World;
meta: {
lastUpdated: string;
commit: string | null;
branch: string | null;
};
children: ReactNode;
}
export function WorldDataProvider({
worldId,
world,
meta,
children,
}: WorldDataProviderProps) {
return (
<WorldDataContext.Provider value={{ worldId, world, meta }}>
{children}
</WorldDataContext.Provider>
);
}
export function useWorldData() {
const context = useContext(WorldDataContext);
if (!context) {
throw new Error('useWorldData must be used within a WorldDataProvider');
}
return context;
}