({
className,
variant = "outline",
size = "icon",
...props
}: React.ComponentProps<typeof Button>)
| 172 | } |
| 173 | |
| 174 | function CarouselPrevious({ |
| 175 | className, |
| 176 | variant = "outline", |
| 177 | size = "icon", |
| 178 | ...props |
| 179 | }: React.ComponentProps<typeof Button>) { |
| 180 | const { orientation, scrollPrev, canScrollPrev } = useCarousel() |
| 181 | |
| 182 | return ( |
| 183 | <Button |
| 184 | data-slot="carousel-previous" |
| 185 | variant={variant} |
| 186 | size={size} |
| 187 | className={cn( |
| 188 | "absolute size-8 rounded-full", |
| 189 | orientation === "horizontal" |
| 190 | ? "top-1/2 -left-12 -translate-y-1/2" |
| 191 | : "-top-12 left-1/2 -translate-x-1/2 rotate-90", |
| 192 | className |
| 193 | )} |
| 194 | disabled={!canScrollPrev} |
| 195 | onClick={scrollPrev} |
| 196 | {...props} |
| 197 | > |
| 198 | <ArrowLeft /> |
| 199 | <span className="sr-only">Previous slide</span> |
| 200 | </Button> |
| 201 | ) |
| 202 | } |
| 203 | |
| 204 | function CarouselNext({ |
| 205 | className, |
nothing calls this directly
no test coverage detected