Files
kycnotme/web/src/components/InputSubmitButton.astro

31 lines
766 B
Plaintext
Raw Normal View History

2025-05-19 10:23:36 +00:00
---
import { cn } from '../lib/cn'
import Button from './Button.astro'
2025-06-02 03:53:03 +00:00
import type { ComponentProps, HTMLAttributes } from 'astro/types'
2025-05-19 10:23:36 +00:00
type Props = HTMLAttributes<'div'> & {
hideCancel?: boolean
icon?: string
label?: string
2025-06-02 03:53:03 +00:00
disabled?: boolean
color?: ComponentProps<typeof Button>['color']
2025-05-19 10:23:36 +00:00
}
const {
hideCancel = false,
icon = 'ri:send-plane-2-line',
label = 'Submit',
2025-06-02 03:53:03 +00:00
disabled = false,
2025-05-19 10:23:36 +00:00
class: className,
2025-06-02 03:53:03 +00:00
color = 'success',
2025-05-19 10:23:36 +00:00
...htmlProps
} = Astro.props
---
<div class={cn('flex justify-between gap-2', className)} {...htmlProps}>
{!hideCancel && <Button as="a" href="/" label="Cancel" icon="ri:close-line" color="gray" />}
2025-06-02 03:53:03 +00:00
<Button type="submit" label={label} icon={icon} class="ml-auto" color={color} disabled={disabled} />
2025-05-19 10:23:36 +00:00
</div>