import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { useHidePersonalData } from '../personalDataSecurity';
import { Tooltip } from '../Tooltip';
import { classNames } from '../utils/classNames';
import { FileBaseName, FileSuffix, StyledTypography } from './styles';
import { useLogic } from './useLogic';
export const Filename = forwardRef((props, forwardedRef) => {
    const { isOverflowed, suffixWithExtension, baseNameProps } = useLogic({
        ...props,
        ref: forwardedRef,
    });
    const { tooltipProps, variant = 'inherit', children, align = 'left', isHidePersonalData, className, ...restProps } = props;
    const hidePersonalDataClassname = useHidePersonalData({
        isEnabled: isHidePersonalData,
    });
    return (_jsx(Tooltip, { title: isOverflowed && children, disableInteractive: true, ...tooltipProps, className: classNames(tooltipProps?.className, hidePersonalDataClassname), children: _jsxs(StyledTypography, { "$align": align, variant: variant, className: classNames(className, hidePersonalDataClassname), ...restProps, children: [_jsx(FileBaseName, { ...baseNameProps }), _jsx(FileSuffix, { children: suffixWithExtension })] }) }));
});
