mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-08-16 05:40:37 +03:00
21 lines
599 B
TypeScript
21 lines
599 B
TypeScript
interface SubmitButtonProps {
|
||
text: string
|
||
loading?: boolean
|
||
disabled?: boolean
|
||
icon?: React.ReactNode
|
||
}
|
||
|
||
function SubmitButton({ text = 'ОК', icon, disabled, loading = false }: SubmitButtonProps) {
|
||
return (
|
||
<button type='submit'
|
||
className={`px-4 py-2 inline-flex items-center gap-2 align-middle justify-center font-bold disabled:cursor-not-allowed rounded clr-btn-primary ${loading ? ' cursor-progress' : ''}`}
|
||
disabled={disabled ?? loading}
|
||
>
|
||
{icon && <span>{icon}</span>}
|
||
{text && <span>{text}</span>}
|
||
</button>
|
||
)
|
||
}
|
||
|
||
export default SubmitButton;
|