import React from "react";
import { Stack, Text, Select, ColorInput } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { AddWatermarkParameters } from "../../../hooks/tools/addWatermark/useAddWatermarkParameters";
import { alphabetOptions } from "../../../constants/addWatermarkConstants";

interface WatermarkTextStyleProps {
  parameters: AddWatermarkParameters;
  onParameterChange: (key: keyof AddWatermarkParameters, value: any) => void;
  disabled?: boolean;
}

const WatermarkTextStyle = ({ parameters, onParameterChange, disabled = false }: WatermarkTextStyleProps) => {
  const { t } = useTranslation();


  return (
    <Stack gap="sm">
      <Stack gap="xs">
        <Text size="xs" fw={500}>
          {t("watermark.settings.color", "Colour")}
        </Text>
        <ColorInput
          value={parameters.customColor}
          onChange={(value) => onParameterChange("customColor", value)}
          disabled={disabled}
          format="hex"
        />
      </Stack>
      
      <Stack gap="xs">
        <Text size="xs" fw={500}>
          {t("watermark.settings.alphabet", "Alphabet")}
        </Text>
        <Select
          value={parameters.alphabet}
          onChange={(value) => value && onParameterChange("alphabet", value)}
          data={alphabetOptions}
          disabled={disabled}
        />
      </Stack>
    </Stack>
  );
};

export default WatermarkTextStyle;
