/*!
 * 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 styled from '@essex/styled-components';
import { memo, useCallback, useMemo } from 'react';
export const CellContainer = /*#__PURE__*/ memo(function CellContainer({ onClick , column , children  }) {
    const handleColumnClick = useCallback((ev)=>{
        column && onClick && onClick(ev, column);
    }, [
        column,
        onClick
    ]);
    const cellStyle = useMemo(()=>{
        const style = {};
        if (onClick) {
            style.cursor = 'pointer';
        }
        if (column?.data?.selected) {
            style.fontWeight = 'bold';
        }
        return style;
    }, [
        onClick,
        column
    ]);
    return /*#__PURE__*/ _jsx(Container, {
        onClick: handleColumnClick,
        style: cellStyle,
        children: children
    });
});
const Container = styled.div`
	display: flex;
	align-items: center;
	height: 100%;
	width: inherit;
	> * {
		&:first-child {
			padding: 6px 8px 6px 12px;
		}
	}
`;
