Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/monorepo commons #2334

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agenta-web/src/components/Playground/Views/TestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const BoxComponent: React.FC<BoxComponentProps> = ({
}
}, [traceSpans])

const activeTrace = useMemo(() => (traces ? traces[0] ?? null : null), [traces])
const activeTrace = useMemo(() => (traces ? (traces[0] ?? null) : null), [traces])
const [selected, setSelected] = useState("")

useEffect(() => {
Expand Down
14 changes: 3 additions & 11 deletions agenta-web/src/lib/helpers/dynamic.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
import dynamic from "next/dynamic"

export function dynamicComponent<T>(path: string, fallback: any = () => null) {
return dynamic<T>(() => import(`@/components/${path}`), {
return dynamic<T>(() => import(`@/ee/components/${path}`), {
loading: fallback,
ssr: false,
})
}

export async function dynamicContext(path: string, fallback?: any) {
try {
return await import(`@/contexts/${path}`)
} catch (error) {
return fallback
}
}

export async function dynamicHook(path: string, fallback: any = () => null) {
try {
return await import(`@/hooks/${path}`)
return await import(`@/ee/contexts/${path}`)
} catch (error) {
return fallback
}
}

export async function dynamicService(path: string, fallback?: any) {
try {
return await import(`@/services/${path}`)
return await import(`@/ee/services/${path}`)
} catch (error) {
return fallback
}
Expand Down
Loading