import { __assign } from "tslib";
import * as React from 'react';
import { View, Text, Switch, TextInput } from 'react-native';
import { Persona } from '@fluentui/react-native';
import { useTheme } from '@fluentui-react-native/theme-types';
import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
import { michaelImageUrl } from './styles';
import { Slider } from '../Common/Slider';
import { commonTestStyles as commonStyles } from '../Common/styles';
var getThemedStyles = themedStyleSheet(function (t) {
    return { textbox: __assign(__assign({}, commonStyles.textBox), { borderColor: t.colors.inputBorder }) };
});
export var CustomizeUsage = function () {
    var _a = React.useState(true), showImage = _a[0], setShowImage = _a[1];
    var _b = React.useState(), coinColor = _b[0], setCoinColor = _b[1];
    var _c = React.useState(), textColor = _c[0], setTextColor = _c[1];
    var _d = React.useState(23), textSize = _d[0], setTextSize = _d[1];
    var _e = React.useState(20), secondarySize = _e[0], setSecondarySize = _e[1];
    var _f = React.useState(17), tertiarySize = _f[0], setTertiarySize = _f[1];
    var _g = React.useState(14), optionalSize = _g[0], setOptionalSize = _g[1];
    var _h = React.useState(), horizontalGap = _h[0], setHorizontalGap = _h[1];
    var _j = React.useState(), verticalGap = _j[0], setVerticalGap = _j[1];
    var theme = useTheme();
    var textBoxBorderStyle = getThemedStyles(theme);
    var CustomizedPersona = React.useMemo(function () {
        var tokens = {
            backgroundColor: coinColor,
            color: textColor,
            textFont: { fontSize: textSize },
            secondaryFont: { fontSize: secondarySize },
            tertiaryFont: { fontSize: tertiarySize },
            optionalFont: { fontSize: optionalSize },
            horizontalGap: horizontalGap,
            verticalGap: verticalGap,
        };
        return Persona.customize({ tokens: tokens });
    }, [coinColor, textColor, textSize, secondarySize, tertiarySize, optionalSize, horizontalGap, verticalGap]);
    return (React.createElement(View, { style: commonStyles.root },
        React.createElement(View, { style: commonStyles.settings },
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Show image"),
                React.createElement(Switch, { value: showImage, onValueChange: setShowImage })),
            React.createElement(TextInput, { accessibilityLabel: "Background color", style: textBoxBorderStyle.textbox, placeholder: "Background color", blurOnSubmit: true, onSubmitEditing: function (e) {
                    setCoinColor(e.nativeEvent.text);
                } }),
            React.createElement(TextInput, { accessibilityLabel: "Initials text color", style: textBoxBorderStyle.textbox, placeholder: "Initials text color", blurOnSubmit: true, onSubmitEditing: function (e) {
                    setTextColor(e.nativeEvent.text);
                } }),
            React.createElement(Text, null, "Primary text size"),
            React.createElement(Slider, { maximum: 50, minimum: 5, initialValue: textSize, style: commonStyles.vmargin, onChange: setTextSize }),
            React.createElement(Text, null, "Secondary text size"),
            React.createElement(Slider, { maximum: 50, minimum: 5, initialValue: secondarySize, style: commonStyles.vmargin, onChange: setSecondarySize }),
            React.createElement(Text, null, "Tertiary text size"),
            React.createElement(Slider, { maximum: 50, minimum: 5, initialValue: tertiarySize, style: commonStyles.vmargin, onChange: setTertiarySize }),
            React.createElement(Text, null, "Optional text size"),
            React.createElement(Slider, { maximum: 50, minimum: 5, initialValue: optionalSize, style: commonStyles.vmargin, onChange: setOptionalSize }),
            React.createElement(Text, null, "Horizontal gap"),
            React.createElement(Slider, { maximum: 100, initialValue: 5, minimum: 0, style: commonStyles.vmargin, onChange: setHorizontalGap }),
            React.createElement(Text, null, "Vertical gap"),
            React.createElement(Slider, { maximum: 20, initialValue: 5, minimum: 0, style: commonStyles.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 ? michaelImageUrl : undefined })));
};
//# sourceMappingURL=CustomizeUsage.js.map