trufflesuite/truffle

View on GitHub
packages/codec-components/src/react/contexts/colors.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { createContext, useContext } from "react";
import type { CodeProps } from "../components/common/code";

export type ColorsContextValue = Partial<
  Record<Exclude<NonNullable<CodeProps["type"]>, "bracket">, string> & {
    bracket: string[];
  }
>;
export const ColorsContext = createContext<ColorsContextValue>({});
export const useColors = () => useContext(ColorsContext);