interstellar_ai/app/components/settings/ButtonSettings.tsx

25 lines
861 B
TypeScript
Raw Permalink Normal View History

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