import {ComponentExporterImporter, PreloadedDynamicValues} from "../ComponentExporterImporter";
import {TestableData} from "../../store";
import {ExportImportTarget} from "../Exporters";
import {LocationOptions} from "../../cards/conditions/Location";

export class LocationExporterImporter implements ComponentExporterImporter<TestableData<LocationOptions>, TestableData<LocationOptions>> {
    type= 'Location'

    /**
     * Remove ids when this is a preset
     */
    exportData(data: TestableData<LocationOptions>, target: ExportImportTarget): TestableData<LocationOptions> {
        return data
    }

    tagDynamicValues({options: {areas}}: TestableData<LocationOptions>, target: ExportImportTarget): PreloadedDynamicValues {
        return {
            category: 'locations',
            values: areas
        };
    }
}