import { useSearchParams } from 'react-router-dom' import { useAppPath } from '@core/hooks/useAppPath' import { RecordDetailPage } from '../../components/records/RecordDetailPage' const PHASE_OPTIONS = [ { label: 'Current', value: 'current' }, { label: 'Future', value: 'future' }, { label: 'Completed', value: 'completed' }, ] const TEAM_OPTIONS = [ { label: 'Unassigned', value: 'unassigned' }, { label: 'Product', value: 'product' }, { label: 'Engineering', value: 'engineering' }, { label: 'Implementation', value: 'implementation' }, { label: 'DevOps', value: 'devops' }, { label: 'QA', value: 'qa' }, { label: 'Delivery', value: 'delivery' }, { label: 'Docs', value: 'docs' }, { label: 'Support', value: 'support' }, { label: 'Sales', value: 'sales' }, { label: 'Management', value: 'management' }, { label: 'Proserve', value: 'proserve' }, { label: 'All', value: '*' }, ] const fields = [ { key: 'title', label: 'Title', type: 'text' as const, source: 'system' as const }, { key: 'description', label: 'Description', type: 'textarea' as const, source: 'system' as const }, { key: 'phase', label: 'Phase', type: 'select' as const, source: 'data' as const, options: PHASE_OPTIONS }, { key: 'team', label: 'Primary Team', type: 'select' as const, source: 'data' as const, options: TEAM_OPTIONS }, { key: 'target_date', label: 'Target Date', type: 'text' as const, source: 'data' as const }, { key: 'start_at', label: 'Start At', type: 'text' as const, source: 'data' as const }, { key: 'end_at', label: 'End At', type: 'text' as const, source: 'data' as const }, { key: 'success_criteria', label: 'Success Criteria', type: 'textarea' as const, source: 'data' as const }, { key: 'initiative_id', label: 'Initiative ID', type: 'text' as const, source: 'data' as const }, ] export default function EpicDetailPage() { const appPath = useAppPath() const [searchParams] = useSearchParams() function beforeSave(payload: any, record: any) { if (!record) { payload.data.initiative_id = searchParams.get('initiative_id') || payload.data.initiative_id } return payload } return ( ) }