"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const useLogic = ({ gridPosition, field, isSortable, startAdornment, onSort, }) => {
    const hasStartAdornment = Boolean(startAdornment);
    const handleSortClick = () => {
        if (field && isSortable) {
            onSort(field);
        }
    };
    const headCellCssVars = {
        '--grid-column-start': gridPosition?.start,
        '--grid-column-end': gridPosition?.end,
    };
    return {
        hasStartAdornment,
        handleSortClick,
        headCellCssVars,
    };
};
exports.useLogic = useLogic;
