"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Filename = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const personalDataSecurity_1 = require("../personalDataSecurity");
const Tooltip_1 = require("../Tooltip");
const classNames_1 = require("../utils/classNames");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
exports.Filename = (0, react_1.forwardRef)((props, forwardedRef) => {
    const { isOverflowed, suffixWithExtension, baseNameProps } = (0, useLogic_1.useLogic)({
        ...props,
        ref: forwardedRef,
    });
    const { tooltipProps, variant = 'inherit', children, align = 'left', isHidePersonalData, className, ...restProps } = props;
    const hidePersonalDataClassname = (0, personalDataSecurity_1.useHidePersonalData)({
        isEnabled: isHidePersonalData,
    });
    return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: isOverflowed && children, disableInteractive: true, ...tooltipProps, className: (0, classNames_1.classNames)(tooltipProps?.className, hidePersonalDataClassname), children: (0, jsx_runtime_1.jsxs)(styles_1.StyledTypography, { "$align": align, variant: variant, className: (0, classNames_1.classNames)(className, hidePersonalDataClassname), ...restProps, children: [(0, jsx_runtime_1.jsx)(styles_1.FileBaseName, { ...baseNameProps }), (0, jsx_runtime_1.jsx)(styles_1.FileSuffix, { children: suffixWithExtension })] }) }));
});
