otterscan/src/search/ResultHeader.tsx

35 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-07-01 18:21:40 +00:00
import React from "react";
import { FeeDisplay } from "./useFeeToggler";
export type ResultHeaderProps = {
feeDisplay: FeeDisplay;
feeDisplayToggler: () => void;
};
const ResultHeader: React.FC<ResultHeaderProps> = ({
feeDisplay,
feeDisplayToggler,
}) => (
<div className="grid grid-cols-12 gap-x-1 bg-gray-100 border-t border-b border-gray-200 px-2 py-2 font-bold text-gray-500 text-sm">
<div className="col-span-2">Txn Hash</div>
<div>Method</div>
<div>Block</div>
<div>Age</div>
<div className="col-span-2 ml-1">From</div>
<div className="col-span-2 ml-1">To</div>
2021-07-01 18:21:40 +00:00
<div className="col-span-2">Value</div>
<div>
<button
className="text-link-blue hover:text-link-blue-hover"
onClick={feeDisplayToggler}
>
2021-08-31 19:49:52 +00:00
{feeDisplay === FeeDisplay.TX_FEE && "Txn Fee"}
{feeDisplay === FeeDisplay.TX_FEE_USD && "Txn Fee (USD)"}
{feeDisplay === FeeDisplay.GAS_PRICE && "Gas Price"}
2021-07-01 18:21:40 +00:00
</button>
</div>
</div>
);
export default React.memo(ResultHeader);