|
1
|
import * as React from "react" |
|
2
|
import { AriaButtonProps, useButton } from "react-aria" |
|
3
|
|
|
4
|
import { IconButton } from "@/components/icon-button" |
|
5
|
|
|
6
|
interface CalendarButtonProps extends AriaButtonProps<"button"> {} |
|
7
|
|
|
8
|
const CalendarButton = React.forwardRef<HTMLButtonElement, CalendarButtonProps>( |
|
9
|
({ children, ...props }, ref) => { |
|
10
|
const innerRef = React.useRef<HTMLButtonElement>(null) |
|
11
|
React.useImperativeHandle(ref, () => innerRef.current as HTMLButtonElement) |
|
12
|
|
|
13
|
const { buttonProps } = useButton(props, innerRef) |
|
14
|
|
|
15
|
return ( |
|
16
|
<IconButton |
|
17
|
size="small" |
|
18
|
variant="transparent" |
|
19
|
className="rounded-[4px]" |
|
20
|
{...buttonProps} |
|
21
|
> |
|
22
|
{children} |
|
23
|
</IconButton> |
|
24
|
) |
|
25
|
} |
|
26
|
) |
|
27
|
CalendarButton.displayName = "CalendarButton" |
|
28
|
|
|
29
|
export { CalendarButton } |