/*!
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project.
 */ import { jsx as _jsx } from "react/jsx-runtime";
import { Sparkbar } from '@essex/charts-react';
import { memo, useMemo } from 'react';
import { useCellDimensions } from '../hooks/index.js';
/**
 * Renders an array-valued cell as a CategoricalBar.
 */ export const CategoricalBarCell = /*#__PURE__*/ memo(function CategoricalBarCell({ column , categories ={}  }) {
    const values = useMemo(()=>Object.values(categories), [
        categories
    ]);
    const dimensions = useCellDimensions(column);
    return /*#__PURE__*/ _jsx(Sparkbar, {
        data: values,
        categorical: true,
        width: dimensions.width,
        height: dimensions.height
    });
});
