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