2024-09-01 17:31:45 +05:30
|
|
|
import { translationAtom } from "@/atoms/translations-atom";
|
|
|
|
import { useAtomValue } from "jotai";
|
|
|
|
|
2023-09-16 16:04:35 +05:30
|
|
|
type CompressionInputProps = {
|
2023-09-13 19:37:45 +05:30
|
|
|
compression: number;
|
2023-09-16 16:04:35 +05:30
|
|
|
handleCompressionChange: (arg: any) => void;
|
2023-07-23 14:37:18 +05:30
|
|
|
};
|
|
|
|
|
2024-10-04 14:45:54 +05:30
|
|
|
export function InputCompression({
|
2023-09-13 19:37:45 +05:30
|
|
|
compression,
|
2023-09-16 16:04:35 +05:30
|
|
|
handleCompressionChange,
|
|
|
|
}: CompressionInputProps) {
|
2024-09-01 17:31:45 +05:30
|
|
|
const t = useAtomValue(translationAtom);
|
|
|
|
|
2023-07-23 14:37:18 +05:30
|
|
|
return (
|
|
|
|
<div className="flex flex-col gap-2">
|
2023-08-30 10:24:16 +05:30
|
|
|
<div className="flex gap-1 text-sm font-medium uppercase">
|
2024-09-01 17:31:45 +05:30
|
|
|
<p className="shrink-0">
|
2024-09-03 13:04:58 +05:30
|
|
|
{t("SETTINGS.IMAGE_COMPRESSION.TITLE", {
|
2024-09-01 17:31:45 +05:30
|
|
|
compression: compression.toString(),
|
|
|
|
})}
|
|
|
|
</p>
|
2023-08-30 10:24:16 +05:30
|
|
|
</div>
|
2023-11-23 11:09:46 +05:30
|
|
|
{compression > 0 && (
|
|
|
|
<p className="text-xs text-base-content/80">
|
2024-09-03 13:04:58 +05:30
|
|
|
{t("SETTINGS.IMAGE_COMPRESSION.DESCRIPTION")}
|
2023-11-23 11:09:46 +05:30
|
|
|
</p>
|
|
|
|
)}
|
2023-07-23 14:37:18 +05:30
|
|
|
<input
|
|
|
|
type="range"
|
|
|
|
placeholder="Type here"
|
|
|
|
className="range range-primary w-full max-w-xs"
|
|
|
|
min={0}
|
|
|
|
max={100}
|
2023-09-13 19:37:45 +05:30
|
|
|
value={compression}
|
2023-09-16 16:04:35 +05:30
|
|
|
onChange={handleCompressionChange}
|
2023-07-23 14:37:18 +05:30
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|