diff --git a/src/components/ModeTab.tsx b/src/components/ModeTab.tsx new file mode 100644 index 0000000..14a33fd --- /dev/null +++ b/src/components/ModeTab.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import { Tab } from "@headlessui/react"; + +const ModeTab: React.FC = ({ children }) => ( + + `border rounded-lg px-2 py-1 bg-gray-100 hover:bg-gray-200 hover:shadow text-xs text-gray-500 hover:text-gray-600 ${ + selected ? "border-blue-300" : "" + }` + } + > + {children} + +); + +export default ModeTab; diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index f2cebce..9f55c3a 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -30,6 +30,7 @@ import PercentageBar from "../components/PercentageBar"; import ExternalLink from "../components/ExternalLink"; import RelativePosition from "../components/RelativePosition"; import PercentagePosition from "../components/PercentagePosition"; +import ModeTab from "../components/ModeTab"; import DecodedInput from "./DecodedInput"; type DetailsProps = { @@ -315,33 +316,9 @@ const Details: React.FC = ({ - - `border rounded-lg px-2 py-1 bg-gray-100 hover:bg-gray-200 hover:shadow text-xs text-gray-500 hover:text-gray-600 ${ - selected ? "border-blue-300" : "" - }` - } - > - Decoded - - - `border rounded-lg px-2 py-1 bg-gray-100 hover:bg-gray-200 hover:shadow text-xs text-gray-500 hover:text-gray-600 ${ - selected ? "border-blue-300" : "" - }` - } - > - Raw - - - `border rounded-lg px-2 py-1 bg-gray-100 hover:bg-gray-200 hover:shadow text-xs text-gray-500 hover:text-gray-600 ${ - selected ? "border-blue-300" : "" - }` - } - > - UTF-8 - + Decoded + Raw + UTF-8 {txDesc && }