Added back our files selected indicator in tools step --------- Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
34 lines
1023 B
TypeScript
34 lines
1023 B
TypeScript
import React from "react";
|
|
import { Text } from "@mantine/core";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
export interface FileStatusIndicatorProps {
|
|
selectedFiles?: File[];
|
|
placeholder?: string;
|
|
}
|
|
|
|
const FileStatusIndicator = ({
|
|
selectedFiles = [],
|
|
placeholder,
|
|
}: FileStatusIndicatorProps) => {
|
|
const { t } = useTranslation();
|
|
const defaultPlaceholder = placeholder || t("files.placeholder", "Select a PDF file in the main view to get started");
|
|
|
|
// Only show content when no files are selected
|
|
if (selectedFiles.length === 0) {
|
|
return (
|
|
<Text size="sm" c="dimmed">
|
|
{defaultPlaceholder}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Text size="sm" c="dimmed" style={{ wordBreak: 'break-word', whiteSpace: 'normal' }}>
|
|
✓ {selectedFiles.length === 1 ? t("fileSelected", "Selected: {{filename}}", { filename: selectedFiles[0]?.name }) : t("filesSelected", "{{count}} files selected", { count: selectedFiles.length })}
|
|
</Text>
|
|
);
|
|
};
|
|
|
|
export default FileStatusIndicator;
|