import { formatValue, getItemCount } from '../utils';
export const useLogic = ({ value, type, color }) => {
    const isExpandable = type === 'object' || type === 'array';
    const isCanCopy = typeof value === 'string' || typeof value === 'number';
    const isGuid = type === 'guid';
    const itemCount = getItemCount(value);
    const expandableText = type === 'array' ? `[${itemCount}]` : `{${itemCount}}`;
    const formattedValue = formatValue(value, type);
    return {
        isExpandable,
        isCanCopy,
        isGuid,
        expandableText,
        formattedValue,
        color,
    };
};
