import { jsx as _jsx } from "react/jsx-runtime";
import { Box, useTheme } from '@mui/material';
import { PickersDay } from '@mui/x-date-pickers/PickersDay';
import { composeSx } from '../../../../../utils/components';
import { isToday } from '../../../../../utils/time';
import Tooltip from '../../../Tooltip';
const DatePickerDay = ({ timezone, day, getDayTooltip, ...dayProps }) => {
    const theme = useTheme();
    const today = isToday(day, timezone);
    const tooltip = getDayTooltip?.(day);
    const pickerDay = (_jsx(PickersDay, { ...dayProps, day: day, today: today, sx: composeSx({
            color: theme.palette.new.text.neutral.brand,
            borderRadius: '8px',
            '&.Mui-selected': {
                backgroundColor: theme.palette.new.action.button.background.primary.default,
            },
            '&.MuiPickersDay-today': {
                backgroundColor: theme.palette.new.action.button.background.primary.default,
                color: theme.palette.new.action.button.text.primary.default,
                borderColor: 'transparent',
                '&:hover': {
                    backgroundColor: theme.palette.new.action.button.background.primary.hover,
                },
                '&:focus': {
                    backgroundColor: theme.palette.new.action.button.background.primary.focus,
                },
                '&.Mui-selected': {
                    backgroundColor: theme.palette.new.action.button.background.primary.default,
                    color: theme.palette.new.action.button.text.primary.default,
                },
            },
        }, dayProps.sx ?? {}) }));
    if (tooltip) {
        return (_jsx(Tooltip, { title: tooltip, children: _jsx(Box, { component: "span", sx: { display: 'inline-block' }, children: pickerDay }) }));
    }
    return pickerDay;
};
export default DatePickerDay;
