* refactor: replacing mobx with jotai Signed-off-by: James <james@jan.ai> Co-authored-by: James <james@jan.ai> Co-authored-by: Louis <louis@jan.ai>
40 lines
944 B
TypeScript
40 lines
944 B
TypeScript
import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/24/outline";
|
|
import React, { PropsWithChildren } from "react";
|
|
|
|
type PropType = PropsWithChildren<
|
|
React.DetailedHTMLProps<
|
|
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
HTMLButtonElement
|
|
>
|
|
>;
|
|
|
|
export const PrevButton: React.FC<PropType> = (props) => {
|
|
const { children, ...restProps } = props;
|
|
|
|
return (
|
|
<button
|
|
className="embla__button embla__button--prev"
|
|
type="button"
|
|
{...restProps}
|
|
>
|
|
<ChevronLeftIcon width={20} height={20} />
|
|
{children}
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export const NextButton: React.FC<PropType> = (props) => {
|
|
const { children, ...restProps } = props;
|
|
|
|
return (
|
|
<button
|
|
className="embla__button embla__button--next"
|
|
type="button"
|
|
{...restProps}
|
|
>
|
|
<ChevronRightIcon width={20} height={20} />
|
|
{children}
|
|
</button>
|
|
);
|
|
};
|