All files / src/components/Sweepstakes/SweepstakesReport TableSearch.tsx

0% Statements 0/3
0% Branches 0/8
0% Functions 0/1
0% Lines 0/3

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 36 37 38 39 40 41 42 43 44 45 46 47 48                                                                                               
import * as React from "react";
// @mui
import Stack from "@mui/material/Stack";
// components
import { Text } from "@common/Text";
import { namespaces } from "localization/resources/i18n.constants";
import { useTranslation } from "react-i18next";
import SearchBar from "@common/SearchBar/SearchBar";
import { palette } from "@palette";
 
type TableSearchProps = {
  value?: string;
  onSubmit?: React.MouseEventHandler<HTMLButtonElement>;
  onDownload?: React.MouseEventHandler<HTMLButtonElement>;
  onChange?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
  isDesktop: boolean;
  id?: string;
};
 
export const TableSearch: React.FC<TableSearchProps> = ({
  value,
  onSubmit,
  id,
  onChange,
  onDownload,
  isDesktop,
}) => {
  const { t } = useTranslation(namespaces.pages.sweepstakes);
  return (
    <Stack
      direction={isDesktop ? "row" : "column"}
      alignItems={isDesktop ? "center" : "flex-start"}
      justifyContent="space-between"
      sx={{ mt: "45px" }}
    >
      <Text
        variant="h5"
        fontWeight="medium"
        sx={{ fontSize: isDesktop ? 20 : 18 }}
        color={palette.neutral[800]}
        mb={isDesktop ? 0 : 1}
      >
        {t("purchases")}
      </Text>
      <SearchBar customId={id} category="products" subCategory="transaction-items" />
    </Stack>
  );
};