mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
14 lines
395 B
TypeScript
14 lines
395 B
TypeScript
import { useContext } from 'react';
|
|
import { FSContext, type FSContextType } from '@/contexts/FSContext';
|
|
|
|
/**
|
|
* Hook to access the filesystem
|
|
* @returns Filesystem context with fs instance
|
|
*/
|
|
export function useFS(): FSContextType {
|
|
const context = useContext(FSContext);
|
|
if (context === undefined) {
|
|
throw new Error('useFS must be used within a FSProvider');
|
|
}
|
|
return context;
|
|
} |