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