React component for adding art layer

I tried to create a simple react component for adding curves adjustment layer, but I didn’t succeed. Could you help me how to improve this code? Also I tried with a single normal layer, but still the same, I got this test log and I didn’t got any error during debugging.

import React from 'react';
import photoshop from 'photoshop';

const newLayer = () => {

    const handleRunButtonClick = async () => {
        console.log("test");
        await photoshop.app.activeDocument.artLayers.add()
        }
    return (
        <>
                <sp-button size="m" quiet variant="accent" onClick={handleRunButtonClick}>Run</sp-button>
        </>
    );
};

export default newLayer;

did you place it in executeAsModal?

core.executeAsModal(async () => {
      await app.activeDocument.layers.add();
}, {commandName: "lay"});