mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-08-04 03:40:45 +08:00
19 lines
414 B
JavaScript
19 lines
414 B
JavaScript
import classNames from 'classnames';
|
|
import { useScrollTarget } from '@ppcp-settings/hooks/useScrollHighlight';
|
|
|
|
const Action = ( { id, children } ) => {
|
|
const { ref, isHighlighted } = useScrollTarget( id );
|
|
|
|
return (
|
|
<div
|
|
className={ classNames( 'ppcp--action', {
|
|
'ppcp-highlight': isHighlighted,
|
|
} ) }
|
|
{ ...( id ? { id, ref } : {} ) }
|
|
>
|
|
{ children }
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Action;
|