import * as React from 'react';
import { Switch, View } from 'react-native';
import { Text } from '@fluentui/react-native';
import { NATIVE_AVATAR_TESTPAGE } from '@fluentui-react-native/e2e-testing';
import { NativeAvatar } from '@fluentui-react-native/experimental-avatar/';
import { Stack } from '@fluentui-react-native/stack';
import { testImageSource, rainbowGradientSource } from './testImageSources';
import { commonTestStyles as commonStyles } from '../Common/styles';
import { Test } from '../Test';
export const BasicAvatar = () => {
    const [showImage, setShowImage] = React.useState(true);
    const [showPresence, setShowPresence] = React.useState(false);
    const [showRing, setShowRing] = React.useState(false);
    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 presence"),
                React.createElement(Switch, { value: showPresence, onValueChange: setShowPresence })),
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Show Ring"),
                React.createElement(Switch, { value: showRing, onValueChange: setShowRing }))),
        React.createElement(NativeAvatar, { primaryText: "Kat Larrson", secondaryText: "Kat.Larrson@example.com", imageSource: showImage ? testImageSource : undefined, presence: showPresence ? 'available' : null, isRingVisible: showRing, size: 'size72' })));
};
export 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(View, { style: commonStyles.root },
        React.createElement(View, { style: commonStyles.settings },
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Custom foreground"),
                React.createElement(Switch, { value: showCustomForeground, onValueChange: setShowCustomForeground })),
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Custom background"),
                React.createElement(Switch, { value: showCustomBackground, onValueChange: setShowCustomBackground })),
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Custom ring color"),
                React.createElement(Switch, { value: showCustomRingColor, onValueChange: setShowCustomRingColor })),
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Custom Border Image"),
                React.createElement(Switch, { value: showCustomBorderImage, onValueChange: setShowCustomBorderImage })),
            React.createElement(View, { style: commonStyles.switch },
                React.createElement(Text, null, "Show Ring Gap"),
                React.createElement(Switch, { value: showRingGap, onValueChange: setShowRingGap }))),
        React.createElement(NativeAvatar, { primaryText: "Kat Larrson", secondaryText: "Kat.Larrson@example.com", ringColor: showCustomRingColor ? 'red' : null, foregroundColor: showCustomForeground ? 'green' : null, backgroundColor: showCustomBackground ? 'blue' : null, customBorderImageSource: showCustomBorderImage ? rainbowGradientSource : null, isRingVisible: true, hasRingInnerGap: showRingGap, size: 'size72' })));
};
const AvatarSizeRamp = () => {
    const allSizes = ['size16', 'size20', 'size24', 'size32', 'size40', 'size56', 'size72'];
    return (React.createElement(Stack, { style: { flexDirection: 'row' } }, allSizes.map((size, index) => (React.createElement(NativeAvatar, { key: index, primaryText: "Kat Larrson", secondaryText: "Kat.Larrson@example.com", size: size })))));
};
const avatarSections = [
    {
        name: 'Basic Avatar',
        testID: NATIVE_AVATAR_TESTPAGE,
        component: BasicAvatar,
    },
    {
        name: 'Custom Colors',
        testID: NATIVE_AVATAR_TESTPAGE,
        component: CustomizeColors,
    },
    {
        name: 'Size Ramp',
        component: AvatarSizeRamp,
    },
];
export 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, { name: "Avatar Test", description: description, sections: avatarSections, status: status });
};
//# sourceMappingURL=NativeAvatarTest.js.map