All files / src/components/ManageMoney/TransactionTable TransactionTableSearch.tsx

100% Statements 6/6
66.66% Branches 4/6
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35                          1x 2x 2x 2x 2x   2x                              
import * as React from "react";
// @mui
import { useTheme } from "@mui/material/styles";
import Stack from "@mui/material/Stack";
// components
import { Text } from "@common/Text";
// localization
import { namespaces } from "localization/resources/i18n.constants";
import { useTranslation } from "react-i18next";
import { useMediaQuery } from "@mui/material";
import { SearchBar } from "@common/SearchBar_V2";
import { getGivecashToWebData } from "@utils/queryString";
 
export const TransactionTableSearch = ({ queryKey }: { queryKey?: string }) => {
  const theme = useTheme();
  const isDesktop = useMediaQuery(theme.breakpoints.up("sm"));
  const { t } = useTranslation(namespaces.pages.manageMoney);
  const { merchantName } = getGivecashToWebData();
 
  return (
    <Stack
      direction={isDesktop ? "row" : "column"}
      alignItems={isDesktop ? "center" : "flex-start"}
      justifyContent="space-between"
    >
      <SearchBar
        onMouseLeave
        onMouseEnter
        queryKey={queryKey}
        initialValue={merchantName || undefined}
      />
    </Stack>
  );
};