import { createContext, useContext } from 'react'; export interface DataListContextType { /** * if true, the items have no minimum height. * @default false */ dense: boolean; /** * Displays a divider between items. * @default true */ divider: boolean; /** * If true, makes all DataList items disabled. * @default false */ disabled?: boolean; } export const DataListContext = createContext | null>(null); export function useDataListContext() { const context = useContext(DataListContext); if (!context) { throw new Error('DataList compound components cannot be rendered outside the DataList component'); } return context; }