import { __assign } from "tslib";
import * as React from 'react';
import { Switch, View, Text, TextInput } from 'react-native';
import { PersonaCoin } from '@fluentui/react-native';
import { useTheme } from '@fluentui-react-native/theme-types';
import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
import { steveBallmerPhotoUrl } from './styles';
import { AlignmentPicker } from '../Common/AlignmentPicker';
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(80), physicalSize = _d[0], setPhysicalSize = _d[1];
    var _e = React.useState(24), iconSize = _e[0], setIconSize = _e[1];
    var _f = React.useState(2), iconStrokeWidth = _f[0], setIconStrokeWidth = _f[1];
    var _g = React.useState(undefined), iconStrokeColor = _g[0], setIconStrokeColor = _g[1];
    var _h = React.useState(14), initialsSize = _h[0], setInitialsSize = _h[1];
    var _j = React.useState(), horizontalAlignment = _j[0], setHorizontalAlignment = _j[1];
    var _k = React.useState(), verticalAlignment = _k[0], setVerticalAlignment = _k[1];
    var _l = React.useState('red'), ringColor = _l[0], setRingColor = _l[1];
    var _m = React.useState(undefined), ringBackgroundColor = _m[0], setRingBackgroundColor = _m[1];
    var _o = React.useState(true), showRing = _o[0], setShowRing = _o[1];
    var _p = React.useState(false), transparent = _p[0], setTransparent = _p[1];
    var theme = useTheme();
    var textBoxBorderStyle = getThemedStyles(theme);
    var CustomizedPersonaCoin = React.useMemo(function () {
        var tokens = {
            backgroundColor: coinColor,
            color: textColor,
            horizontalIconAlignment: horizontalAlignment,
            verticalIconAlignment: verticalAlignment,
            iconSize: iconSize,
            iconStrokeWidth: iconStrokeWidth,
            iconStrokeColor: iconStrokeColor,
            initialsSize: initialsSize,
            coinSize: physicalSize,
        };
        return PersonaCoin.customize({ tokens: tokens });
    }, [
        coinColor,
        textColor,
        horizontalAlignment,
        verticalAlignment,
        iconSize,
        iconStrokeWidth,
        iconStrokeColor,
        initialsSize,
        physicalSize,
    ]);
    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(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Show rings"),
                React.createElement(Switch, { value: showRing, onValueChange: setShowRing })),
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Transparent Ring"),
                React.createElement(Switch, { value: transparent, onValueChange: setTransparent })),
            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(TextInput, { accessibilityLabel: "Icon stroke color", style: textBoxBorderStyle.textbox, placeholder: "Icon stroke color", blurOnSubmit: true, onSubmitEditing: function (e) {
                    setIconStrokeColor(e.nativeEvent.text);
                } }),
            React.createElement(TextInput, { accessibilityLabel: "Ring color", style: textBoxBorderStyle.textbox, placeholder: "Ring color", blurOnSubmit: true, onSubmitEditing: function (e) {
                    setRingColor(e.nativeEvent.text);
                } }),
            React.createElement(TextInput, { accessibilityLabel: "Ring background color", style: textBoxBorderStyle.textbox, placeholder: "Ring background color", blurOnSubmit: true, onSubmitEditing: function (e) {
                    setRingBackgroundColor(e.nativeEvent.text);
                } }),
            React.createElement(AlignmentPicker, { style: commonStyles.header, label: "Horizontal icon alignment", onSelectionChange: setHorizontalAlignment }),
            React.createElement(AlignmentPicker, { style: commonStyles.header, label: "Vertical icon alignment", onSelectionChange: setVerticalAlignment }),
            React.createElement(Text, null, "Coin size"),
            React.createElement(Slider, { minimum: 8, maximum: 200, initialValue: 80, style: commonStyles.vmargin, onChange: setPhysicalSize }),
            React.createElement(Text, null, "Icon size"),
            React.createElement(Slider, { minimum: 8, maximum: 100, initialValue: 24, style: commonStyles.vmargin, onChange: setIconSize }),
            React.createElement(Text, null, "Icon stroke width"),
            React.createElement(Slider, { minimum: 0, maximum: 8, initialValue: 2, style: commonStyles.vmargin, onChange: setIconStrokeWidth }),
            React.createElement(Text, null, "Font size"),
            React.createElement(Slider, { minimum: 5, maximum: 50, initialValue: 14, style: commonStyles.vmargin, onChange: setInitialsSize })),
        React.createElement(CustomizedPersonaCoin, { initials: "SB", imageDescription: "Former CEO of Microsoft", presence: "blocked", imageUrl: showImage ? steveBallmerPhotoUrl : undefined, ring: showRing
                ? {
                    ringColor: ringColor,
                    ringBackgroundColor: ringBackgroundColor,
                    ringThickness: 4,
                    innerGap: 4,
                    transparent: transparent,
                }
                : undefined })));
};
//# sourceMappingURL=CustomizeUsage.js.map