Files
parcer/src/components/action/action-settings/ScrapeSchema.tsx

26 lines
786 B
TypeScript
Raw Normal View History

2025-01-09 21:26:59 +05:30
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
import { WarningText } from "../../ui/texts";
2024-06-22 20:00:03 +05:30
import InfoIcon from "@mui/icons-material/Info";
2025-01-09 20:09:46 +05:30
import { KeyValueForm } from "../../recorder/KeyValueForm";
2024-06-22 20:00:03 +05:30
export const ScrapeSchemaSettings = forwardRef((props, ref) => {
2024-06-22 20:01:55 +05:30
const keyValueFormRef = useRef<{ getObject: () => object }>(null);
2024-06-22 20:00:03 +05:30
useImperativeHandle(ref, () => ({
getSettings() {
2024-06-22 20:01:55 +05:30
const settings = keyValueFormRef.current?.getObject() as Record<string, string>
2024-06-22 20:00:03 +05:30
return settings;
}
}));
return (
<div>
<WarningText>
2024-06-22 20:01:55 +05:30
<InfoIcon color='warning' />
2024-06-22 20:00:03 +05:30
The interpreter scrapes the data from a webpage into a "curated" table.
</WarningText>
2024-06-22 20:01:55 +05:30
<KeyValueForm ref={keyValueFormRef} />
2024-06-22 20:00:03 +05:30
</div>
2024-06-22 20:01:55 +05:30
);
2024-06-22 20:00:03 +05:30
});