Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(CreateTearsheetDivider): convert to typescript #4584

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright IBM Corp. 2021, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import React, { ForwardedRef, forwardRef } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { pkg } from '../../settings';

const componentName = 'CreateTearsheetDivider';
const blockClass = `${pkg.prefix}--tearsheet-create__section--divider`;

interface CreateTearsheetDividerProps {
/** Specifies an optional className to be added to the tearsheet divider */
className?: string;
}

export let CreateTearsheetDivider: React.FC<CreateTearsheetDividerProps> =
forwardRef(
(
{
className,
// Collect any other property values passed in
...rest
},
ref: ForwardedRef<HTMLSpanElement>
) => {
return <span {...rest} ref={ref} className={cx(blockClass, className)} />;
}
);

// Return a placeholder if not released and not enabled by feature flag
CreateTearsheetDivider = pkg.checkComponentEnabled(
CreateTearsheetDivider,
componentName
);

CreateTearsheetDivider.propTypes = {
/**
* Sets an optional className to be added to the tearsheet divider
*/
className: PropTypes.string,
};
Loading