"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomizeUsage = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_native_1 = require("react-native");
const react_native_2 = require("@fluentui/react-native");
const theme_types_1 = require("@fluentui-react-native/theme-types");
const themed_stylesheet_1 = require("@fluentui-react-native/themed-stylesheet");
const styles_1 = require("./styles");
const Slider_1 = require("../Common/Slider");
const styles_2 = require("../Common/styles");
const getThemedStyles = (0, themed_stylesheet_1.themedStyleSheet)((t) => {
    return { textbox: { ...styles_2.commonTestStyles.textBox, borderColor: t.colors.inputBorder } };
});
const CustomizeUsage = () => {
    const [showImage, setShowImage] = React.useState(true);
    const [coinColor, setCoinColor] = React.useState();
    const [textColor, setTextColor] = React.useState();
    const [textSize, setTextSize] = React.useState(23);
    const [secondarySize, setSecondarySize] = React.useState(20);
    const [tertiarySize, setTertiarySize] = React.useState(17);
    const [optionalSize, setOptionalSize] = React.useState(14);
    const [horizontalGap, setHorizontalGap] = React.useState();
    const [verticalGap, setVerticalGap] = React.useState();
    const theme = (0, theme_types_1.useTheme)();
    const textBoxBorderStyle = getThemedStyles(theme);
    const CustomizedPersona = React.useMemo(() => {
        const tokens = {
            backgroundColor: coinColor,
            color: textColor,
            textFont: { fontSize: textSize },
            secondaryFont: { fontSize: secondarySize },
            tertiaryFont: { fontSize: tertiarySize },
            optionalFont: { fontSize: optionalSize },
            horizontalGap: horizontalGap,
            verticalGap: verticalGap,
        };
        return react_native_2.Persona.customize({ tokens });
    }, [coinColor, textColor, textSize, secondarySize, tertiarySize, optionalSize, horizontalGap, verticalGap]);
    return (React.createElement(react_native_1.View, { style: styles_2.commonTestStyles.root },
        React.createElement(react_native_1.View, { style: styles_2.commonTestStyles.settings },
            React.createElement(react_native_1.View, { style: styles_2.commonTestStyles.switch },
                React.createElement(react_native_1.Text, null, "Show image"),
                React.createElement(react_native_1.Switch, { value: showImage, onValueChange: setShowImage })),
            React.createElement(react_native_1.TextInput, { accessibilityLabel: "Background color", style: textBoxBorderStyle.textbox, placeholder: "Background color", blurOnSubmit: true, onSubmitEditing: (e) => {
                    setCoinColor(e.nativeEvent.text);
                } }),
            React.createElement(react_native_1.TextInput, { accessibilityLabel: "Initials text color", style: textBoxBorderStyle.textbox, placeholder: "Initials text color", blurOnSubmit: true, onSubmitEditing: (e) => {
                    setTextColor(e.nativeEvent.text);
                } }),
            React.createElement(react_native_1.Text, null, "Primary text size"),
            React.createElement(Slider_1.Slider, { maximum: 50, minimum: 5, initialValue: textSize, style: styles_2.commonTestStyles.vmargin, onChange: setTextSize }),
            React.createElement(react_native_1.Text, null, "Secondary text size"),
            React.createElement(Slider_1.Slider, { maximum: 50, minimum: 5, initialValue: secondarySize, style: styles_2.commonTestStyles.vmargin, onChange: setSecondarySize }),
            React.createElement(react_native_1.Text, null, "Tertiary text size"),
            React.createElement(Slider_1.Slider, { maximum: 50, minimum: 5, initialValue: tertiarySize, style: styles_2.commonTestStyles.vmargin, onChange: setTertiarySize }),
            React.createElement(react_native_1.Text, null, "Optional text size"),
            React.createElement(Slider_1.Slider, { maximum: 50, minimum: 5, initialValue: optionalSize, style: styles_2.commonTestStyles.vmargin, onChange: setOptionalSize }),
            React.createElement(react_native_1.Text, null, "Horizontal gap"),
            React.createElement(Slider_1.Slider, { maximum: 100, initialValue: 5, minimum: 0, style: styles_2.commonTestStyles.vmargin, onChange: setHorizontalGap }),
            React.createElement(react_native_1.Text, null, "Vertical gap"),
            React.createElement(Slider_1.Slider, { maximum: 20, initialValue: 5, minimum: 0, style: styles_2.commonTestStyles.vmargin, onChange: setVerticalGap })),
        React.createElement(CustomizedPersona, { initials: "MJ", size: "size72", text: "Michael Jackson", secondaryText: "Pop singer", tertiaryText: "King of pop", optionalText: "Indiana", imageDescription: "Legendary pop singer", presence: "offline", imageUrl: showImage ? styles_1.michaelImageUrl : undefined })));
};
exports.CustomizeUsage = CustomizeUsage;
//# sourceMappingURL=CustomizeUsage.js.map