"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.PHXText = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const ErrorMessage_1 = tslib_1.__importDefault(require("../../commons/ErrorMessage"));
const PHXText = ({ as = 'p', children, className, size = 'xs', tone = 'default' }) => {
    const Component = as || 'p';
    const getToneClass = () => {
        switch (tone) {
            case 'subdued':
                return 'text-gray-500';
            case 'error':
                return 'text-red-800';
            default:
                return 'text-gray-700';
        }
    };
    const Element = (react_1.default.createElement(Component, { className: `text-${size} ${getToneClass()}  leading-5 ${className} ` }, children));
    if (tone === 'error') {
        return react_1.default.createElement(ErrorMessage_1.default, { message: children });
    }
    return Element;
};
exports.PHXText = PHXText;
//# sourceMappingURL=Text.js.map