27 lines
761 B
TypeScript
27 lines
761 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import ViewOnMapIcon from "../../../icons/ViewOnMapIcon";
|
|
|
|
type ViewOnMapProps = {
|
|
onClick?: () => void;
|
|
isVillaSelected?: boolean;
|
|
};
|
|
|
|
const ViewOnMapButton = ({ onClick, isVillaSelected }: ViewOnMapProps) => {
|
|
const [t, i18n] = useTranslation();
|
|
return (
|
|
<button
|
|
className={`w-1/2 flex justify-center gap-1 items-center hover:bg-secondary transition-all duration-200 ${
|
|
i18n.language === "ar"
|
|
? "rounded-ee-2xl border-l flex-row-reverse"
|
|
: "rounded-es-2xl border-r"
|
|
} ${isVillaSelected ? "bg-[#EAE5E0] rounded-es-2xl " : ""}`}
|
|
onClick={onClick}
|
|
>
|
|
{t("ViewOnMap")}
|
|
<ViewOnMapIcon />
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export default ViewOnMapButton;
|