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

import type { JSXElement } from "@coreai-ds/react-components";
import * as React from 'react';
import { Rating } from "@coreai-ds/react-components";
import { Button } from "@coreai-ds/react-components";

export const ControlledValue = (): JSXElement => {
    const [value, setValue] = React.useState(4);
    return (<>
      <Rating value={value} onChange={(_, data) => setValue(data.value)}/>
      <Button onClick={() => setValue(0)}>Clear Rating</Button>
    </>);
};

export default ControlledValue;
