// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import type { JSXElement } from "@coreai-ds/react-components";
import * as React from 'react';
import { makeStyles } from "@coreai-ds/react-components";
import { ToggleButton } from "@coreai-ds/react-components";
import { bundleIcon } from "@fluentui/react-icons";
import { CalendarMonthFilled } from "@fluentui/react-icons";
import { CalendarMonthRegular } from "@fluentui/react-icons";

const useStyles = makeStyles({
    wrapper: {
        columnGap: '15px',
        display: 'flex',
        minWidth: 'min-content',
    },
});

const CalendarMonth = bundleIcon(CalendarMonthFilled, CalendarMonthRegular);

export const Appearance = (): JSXElement => {
    const [checked1, setChecked1] = React.useState(false);
    const [checked2, setChecked2] = React.useState(false);
    const styles = useStyles();
    const toggleChecked = React.useCallback((buttonIndex: number) => {
        switch (buttonIndex) {
            case 1:
                setChecked1(!checked1);
                break;
            case 2:
                setChecked2(!checked2);
                break;
        }
    }, [checked1, checked2]);
    return (<div className={styles.wrapper}>
      <ToggleButton checked={checked1} icon={checked1 ? <CalendarMonth /> : <CalendarMonthRegular />} onClick={() => toggleChecked(1)}>
        Default
      </ToggleButton>
      <ToggleButton appearance="primary" checked={checked2} icon={checked2 ? <CalendarMonth /> : <CalendarMonthRegular />} onClick={() => toggleChecked(2)}>
        Primary
      </ToggleButton>
      <ToggleButton appearance="outline" icon={<CalendarMonth />} onClick={() => toggleChecked(3)}>
        Outline
      </ToggleButton>
      <ToggleButton appearance="subtle" icon={<CalendarMonth />}>
        Subtle
      </ToggleButton>
      <ToggleButton appearance="transparent" icon={<CalendarMonth />}>
        Transparent
      </ToggleButton>
    </div>);
};

export default Appearance;
