otterscan/src/components/ModeTab.tsx

27 lines
631 B
TypeScript
Raw Normal View History

2022-08-07 02:32:08 +00:00
import React, { PropsWithChildren } from "react";
2021-09-18 18:08:44 +00:00
import { Tab } from "@headlessui/react";
type ModeTabProps = {
disabled?: boolean | undefined;
};
2022-08-07 02:32:08 +00:00
const ModeTab: React.FC<PropsWithChildren<ModeTabProps>> = ({
disabled,
children,
}) => (
2021-09-18 18:08:44 +00:00
<Tab
className={({ selected }) =>
`border rounded-lg px-2 py-1 bg-gray-100 ${
disabled
2021-11-08 17:57:51 +00:00
? "border-gray-100 text-gray-300 cursor-default"
: "hover:bg-gray-200 hover:shadow text-gray-500 hover:text-gray-600"
} text-xs ${selected ? "border-blue-300" : ""}`
2021-09-18 18:08:44 +00:00
}
disabled={disabled}
2021-09-18 18:08:44 +00:00
>
{children}
</Tab>
);
export default ModeTab;