Sha256: 8a5dd6d4210de251be3c1feffc230974c79f3c0f41208eb5025d50bba9c56367

Contents?: true

Size: 1.61 KB

Versions: 44

Compression:

Stored size: 1.61 KB

Contents

import React from 'react';
import { Code2 } from 'lucide-react';
import { mockDatasets, mockFeatureGroups } from '../mockData';
import { FeatureForm } from '../components/features/FeatureForm';

export default function EditFeaturePage() {
  const navigate = useNavigate();
  const { id } = useParams();
  
  const feature = mockFeatureGroups
    .flatMap(g => g.features)
    .find(t => t.id === Number(id));

  if (!feature) {
    return (
      <div className="text-center py-12">
        <h2 className="text-xl font-semibold text-gray-900">Feature not found</h2>
      </div>
    );
  }

  const handleSubmit = (data: any) => {
    console.log('Updating feature:', data);
    navigate('/features');
  };

  return (
    <div className="max-w-4xl mx-auto p-8">
      <div className="bg-white rounded-lg shadow-lg">
        <div className="px-6 py-4 border-b border-gray-200">
          <div className="flex items-center gap-3">
            <Code2 className="w-6 h-6 text-blue-600" />
            <h2 className="text-xl font-semibold text-gray-900">Edit Feature</h2>
          </div>
        </div>

        <FeatureForm
          datasets={mockDatasets}
          groups={mockFeatureGroups}
          initialData={{
            name: feature.name,
            description: feature.description,
            groupId: feature.groupId,
            testDatasetId: feature.testDatasetId,
            inputColumns: feature.inputColumns,
            outputColumns: feature.outputColumns,
            code: feature.code
          }}
          onSubmit={handleSubmit}
          onCancel={() => navigate('/features')}
        />
      </div>
    </div>
  );
}

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
easy_ml-0.2.0.pre.rc47 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc46 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc45 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc44 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc43 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc41 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc40 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc39 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc38 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc37 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc36 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc35 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc34 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc33 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc32 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc31 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc30 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc29 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc28 app/frontend/pages/EditTransformationPage.tsx
easy_ml-0.2.0.pre.rc27 app/frontend/pages/EditTransformationPage.tsx