diff --git a/src/api/automationApi.ts b/src/api/automationApi.ts index 296933b..38d560c 100644 --- a/src/api/automationApi.ts +++ b/src/api/automationApi.ts @@ -22,6 +22,7 @@ export interface Automation { _updatedAt?: number; _createdByUserName?: string; mandateName?: string; + featureInstanceName?: string; [key: string]: any; } diff --git a/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.module.css b/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.module.css index d9ed884..2aa4da0 100644 --- a/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.module.css +++ b/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.module.css @@ -37,6 +37,43 @@ white-space: nowrap; } +/* CSV Export Button */ +.csvExportButton { + display: inline-flex; + align-items: center; + gap: 5px; + height: 40px; + padding: 0 14px; + border: 1px solid var(--color-primary); + border-radius: 25px; + background: var(--color-bg); + color: var(--color-text); + font-size: 12px; + font-family: var(--font-family); + font-weight: 400; + cursor: pointer; + transition: all 0.15s ease; + white-space: nowrap; + flex-shrink: 0; +} + +.csvExportButton:hover:not(:disabled) { + background: var(--color-secondary); + color: var(--color-bg); + border-color: var(--color-secondary); +} + +.csvExportButton:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.csvExportIcon { + font-size: 13px; + display: flex; + align-items: center; +} + .refreshButton { display: flex; align-items: center; diff --git a/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.tsx b/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.tsx index 04b233f..719be78 100644 --- a/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.tsx +++ b/src/components/FormGenerator/FormGeneratorControls/FormGeneratorControls.tsx @@ -3,7 +3,7 @@ import { useLanguage } from '../../../providers/language/LanguageContext'; import styles from './FormGeneratorControls.module.css'; import { Button } from '../../UiComponents/Button'; import { IoIosRefresh } from "react-icons/io"; -import { FaTrash } from "react-icons/fa"; +import { FaTrash, FaDownload } from "react-icons/fa"; import type { AttributeType } from '../../../utils/attributeTypeMapper'; // Generic field/column config interface @@ -62,6 +62,9 @@ export interface FormGeneratorControlsProps { onPageSizeChange?: (pageSize: number) => void; supportsBackendPagination?: boolean; hookData?: any; + // CSV Export + onCsvExport?: () => void; + csvExporting?: boolean; } export function FormGeneratorControls({ @@ -87,7 +90,9 @@ export function FormGeneratorControls({ onPageChange, onPageSizeChange, supportsBackendPagination = false, - hookData: _hookData // Reserved for future use + hookData: _hookData, // Reserved for future use + onCsvExport, + csvExporting = false }: FormGeneratorControlsProps) { void _hookData; // Suppress unused variable warning const { t } = useLanguage(); @@ -147,6 +152,17 @@ export function FormGeneratorControls({ {activeFiltersCount} {t('formgen.filter.active', 'filter(s)')} )} + {onCsvExport && ( + + )} {onRefresh && (