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

import type { JSXElement } from "@coreai-ds/react-components";
import { Field } from "@coreai-ds/react-components";
import { Textarea } from "@coreai-ds/react-components";
import type { TextareaProps } from "@coreai-ds/react-components";
import * as React from 'react';

const onChange: TextareaProps['onChange'] = (ev, data) => {
    // Uncontrolled inputs can be notified of changes to the value
    console.log(`New value: "${data.value}"`);
};

export const Uncontrolled = (): JSXElement => (<Field label="Uncontrolled Textarea" hint="Check console for new value">
    <Textarea onChange={onChange} placeholder="type here..."/>
  </Field>);

export default Uncontrolled;
