"use client";

import { FC, PropsWithChildren } from "react";
import { Button } from "@mantine/core";
import SmallPageBlock from "@/components/layout/SmallPageBlock/SmallPageBlock";
import style from "./ViewSelectButton.module.css";

type Props = {
    selected: boolean;
    onSelect: () => void;
};

const ViewSelectButton: FC<PropsWithChildren<Props>> = ({
    selected,
    onSelect,
    children,
}) => {
    return (
        <SmallPageBlock
            active={selected}
            style={{ borderRadius: "var(--mantine-radius-xl)" }}>
            <Button
                unstyled
                onClick={onSelect}
                radius="xl"
                className={style.container}>
                {children}
            </Button>
        </SmallPageBlock>
    );
};

export default ViewSelectButton;
