"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NativeAvatarTest = exports.CustomizeColors = exports.BasicAvatar = 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 e2e_testing_1 = require("@fluentui-react-native/e2e-testing");
const experimental_avatar_1 = require("@fluentui-react-native/experimental-avatar/");
const stack_1 = require("@fluentui-react-native/stack");
const testImageSources_1 = require("./testImageSources");
const styles_1 = require("../Common/styles");
const Test_1 = require("../Test");
const BasicAvatar = () => {
    const [showImage, setShowImage] = React.useState(true);
    const [showPresence, setShowPresence] = React.useState(false);
    const [showRing, setShowRing] = React.useState(false);
    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;
const CustomizeColors = () => {
    const [showCustomRingColor, setShowCustomRingColor] = React.useState(false);
    const [showCustomForeground, setShowCustomForeground] = React.useState(false);
    const [showCustomBackground, setShowCustomBackground] = React.useState(false);
    const [showCustomBorderImage, setShowCustomBorderImage] = React.useState(false);
    const [showRingGap, setShowRingGap] = React.useState(false);
    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;
const AvatarSizeRamp = () => {
    const allSizes = ['size16', 'size20', 'size24', 'size32', 'size40', 'size56', 'size72'];
    return (React.createElement(stack_1.Stack, { style: { flexDirection: 'row' } }, allSizes.map((size, index) => (React.createElement(experimental_avatar_1.NativeAvatar, { key: index, primaryText: "Kat Larrson", secondaryText: "Kat.Larrson@example.com", size: size })))));
};
const avatarSections = [
    {
        name: 'Basic Avatar',
        testID: e2e_testing_1.NATIVE_AVATAR_TESTPAGE,
        component: exports.BasicAvatar,
    },
    {
        name: 'Custom Colors',
        testID: e2e_testing_1.NATIVE_AVATAR_TESTPAGE,
        component: exports.CustomizeColors,
    },
    {
        name: 'Size Ramp',
        component: AvatarSizeRamp,
    },
];
const NativeAvatarTest = () => {
    const status = {
        win32Status: 'Backlog',
        uwpStatus: 'Backlog',
        iosStatus: 'Beta',
        macosStatus: 'Experimental',
        androidStatus: 'Backlog',
    };
    const 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