Button settings comment

This commit is contained in:
sageTheDM 2024-10-11 09:27:16 +02:00
parent 162e84cb7e
commit 7502591022

View file

@ -1,17 +1,19 @@
import React from 'react'; import React from 'react';
// Define the props for the ButtonSetting component
interface ButtonSettingProps { interface ButtonSettingProps {
label: string; // The label to display on the button label: string; // The label to display on the button
onClick: () => void; // The function to call when the button is clicked onClick: () => void; // The function to call when the button is clicked
className?: string; // Optional additional classes for styling className?: string; // Optional additional classes for styling
} }
const ButtonSetting: React.FC<ButtonSettingProps> = ({ label, onClick }) => { // Functional component definition
const ButtonSetting: React.FC<ButtonSettingProps> = ({ label, onClick, className }) => {
return ( return (
<div className="settings-option"> <div className="settings-option"> {/* Container for the button */}
<button <button
onClick={onClick} // Call the onClick function when the button is clicked onClick={onClick} // Call the onClick function when the button is clicked
className={"export-button"} // Apply any additional classes className={`export-button ${className || ''}`} // Apply any additional classes, default to empty if not provided
> >
{label} {/* Display the label on the button */} {label} {/* Display the label on the button */}
</button> </button>