"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NativeAvatarTest = exports.CustomizeColors = exports.BasicAvatar = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var react_native_1 = require("react-native");
var react_native_2 = require("@fluentui/react-native");
var experimental_avatar_1 = require("@fluentui-react-native/experimental-avatar/");
var stack_1 = require("@fluentui-react-native/stack");
var testImageSources_1 = require("./testImageSources");
var consts_1 = require("../../../../E2E/src/Avatar/consts");
var styles_1 = require("../Common/styles");
var Test_1 = require("../Test");
var BasicAvatar = function () {
    var _a = React.useState(true), showImage = _a[0], setShowImage = _a[1];
    var _b = React.useState(false), showPresence = _b[0], setShowPresence = _b[1];
    var _c = React.useState(false), showRing = _c[0], setShowRing = _c[1];
    return (React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.root },
        React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.settings },
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Show image"),
                React.createElement(react_native_1.Switch, { value: showImage, onValueChange: setShowImage })),
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Show presence"),
                React.createElement(react_native_1.Switch, { value: showPresence, onValueChange: setShowPresence })),
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Show Ring"),
                React.createElement(react_native_1.Switch, { value: showRing, onValueChange: setShowRing }))),
        React.createElement(experimental_avatar_1.NativeAvatar, { primaryText: "Kat Larrson", secondaryText: "Kat.Larrson@example.com", imageSource: showImage ? testImageSources_1.testImageSource : undefined, presence: showPresence ? 'available' : null, isRingVisible: showRing, size: 'size72' })));
};
exports.BasicAvatar = BasicAvatar;
var CustomizeColors = function () {
    var _a = React.useState(false), showCustomRingColor = _a[0], setShowCustomRingColor = _a[1];
    var _b = React.useState(false), showCustomForeground = _b[0], setShowCustomForeground = _b[1];
    var _c = React.useState(false), showCustomBackground = _c[0], setShowCustomBackground = _c[1];
    var _d = React.useState(false), showCustomBorderImage = _d[0], setShowCustomBorderImage = _d[1];
    var _e = React.useState(false), showRingGap = _e[0], setShowRingGap = _e[1];
    return (React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.root },
        React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.settings },
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Custom foreground"),
                React.createElement(react_native_1.Switch, { value: showCustomForeground, onValueChange: setShowCustomForeground })),
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Custom background"),
                React.createElement(react_native_1.Switch, { value: showCustomBackground, onValueChange: setShowCustomBackground })),
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Custom ring color"),
                React.createElement(react_native_1.Switch, { value: showCustomRingColor, onValueChange: setShowCustomRingColor })),
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Custom Border Image"),
                React.createElement(react_native_1.Switch, { value: showCustomBorderImage, onValueChange: setShowCustomBorderImage })),
            React.createElement(react_native_1.View, { style: styles_1.commonTestStyles.switch },
                React.createElement(react_native_2.Text, null, "Show Ring Gap"),
                React.createElement(react_native_1.Switch, { value: showRingGap, onValueChange: setShowRingGap }))),
        React.createElement(experimental_avatar_1.NativeAvatar, { primaryText: "Kat Larrson", secondaryText: "Kat.Larrson@example.com", ringColor: showCustomRingColor ? 'red' : null, foregroundColor: showCustomForeground ? 'green' : null, backgroundColor: showCustomBackground ? 'blue' : null, customBorderImageSource: showCustomBorderImage ? testImageSources_1.rainbowGradientSource : null, isRingVisible: true, hasRingInnerGap: showRingGap, size: 'size72' })));
};
exports.CustomizeColors = CustomizeColors;
var AvatarSizeRamp = function () {
    var allSizes = ['size16', 'size20', 'size24', 'size32', 'size40', 'size56', 'size72'];
    return (React.createElement(stack_1.Stack, { style: { flexDirection: 'row' } }, allSizes.map(function (size, index) { return (React.createElement(experimental_avatar_1.NativeAvatar, { key: index, primaryText: "Kat Larrson", secondaryText: "Kat.Larrson@example.com", size: size })); })));
};
var avatarSections = [
    {
        name: 'Basic Avatar',
        testID: consts_1.NATIVE_AVATAR_TESTPAGE,
        component: exports.BasicAvatar,
    },
    {
        name: 'Custom Colors',
        testID: consts_1.NATIVE_AVATAR_TESTPAGE,
        component: exports.CustomizeColors,
    },
    {
        name: 'Size Ramp',
        component: AvatarSizeRamp,
    },
];
var NativeAvatarTest = function () {
    var status = {
        win32Status: 'Backlog',
        uwpStatus: 'Backlog',
        iosStatus: 'Beta',
        macosStatus: 'Experimental',
        androidStatus: 'Backlog',
    };
    var description = 'AvatarView is a visual representation of a user, entity, or group. If an image is supplied, it is cropped to a circle of the requested size. If an image is not supplied, initials are extracted from the given name and email address provided and displayed on a colorful background.';
    return React.createElement(Test_1.Test, { name: "Avatar Test", description: description, sections: avatarSections, status: status });
};
exports.NativeAvatarTest = NativeAvatarTest;
//# sourceMappingURL=NativeAvatarTest.js.map