31 lines
766 B
Plaintext
31 lines
766 B
Plaintext
---
|
|
import { cn } from '../lib/cn'
|
|
|
|
import Button from './Button.astro'
|
|
|
|
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
|
|
type Props = HTMLAttributes<'div'> & {
|
|
hideCancel?: boolean
|
|
icon?: string
|
|
label?: string
|
|
disabled?: boolean
|
|
color?: ComponentProps<typeof Button>['color']
|
|
}
|
|
|
|
const {
|
|
hideCancel = false,
|
|
icon = 'ri:send-plane-2-line',
|
|
label = 'Submit',
|
|
disabled = false,
|
|
class: className,
|
|
color = 'success',
|
|
...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" />}
|
|
<Button type="submit" label={label} icon={icon} class="ml-auto" color={color} disabled={disabled} />
|
|
</div>
|