mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-12 12:51:18 +01:00
refactor: replace eslint/prettier with oxlint/oxfmt in admin-dashboard
Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { createRoute } from "@tanstack/react-router"
|
||||
|
||||
import { FeedPanel } from "@/components/feed-panel"
|
||||
|
||||
import { Route as dashboardRoute } from "../_dashboard"
|
||||
|
||||
export const Route = createRoute({
|
||||
getParentRoute: () => dashboardRoute,
|
||||
path: "/feed",
|
||||
component: FeedPanel,
|
||||
getParentRoute: () => dashboardRoute,
|
||||
path: "/feed",
|
||||
component: FeedPanel,
|
||||
})
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { createRoute } from "@tanstack/react-router"
|
||||
|
||||
import { GeneralSettingsPanel } from "@/components/general-settings-panel"
|
||||
|
||||
import { Route as dashboardRoute } from "../_dashboard"
|
||||
|
||||
export const Route = createRoute({
|
||||
getParentRoute: () => dashboardRoute,
|
||||
path: "/",
|
||||
component: GeneralSettingsPanel,
|
||||
getParentRoute: () => dashboardRoute,
|
||||
path: "/",
|
||||
component: GeneralSettingsPanel,
|
||||
})
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
import { createRoute } from "@tanstack/react-router"
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query"
|
||||
import { createRoute } from "@tanstack/react-router"
|
||||
|
||||
import { fetchSources } from "@/lib/api"
|
||||
import { SourceConfigPanel } from "@/components/source-config-panel"
|
||||
import { fetchSources } from "@/lib/api"
|
||||
|
||||
import { Route as dashboardRoute } from "../_dashboard"
|
||||
|
||||
export const Route = createRoute({
|
||||
getParentRoute: () => dashboardRoute,
|
||||
path: "/sources/$sourceId",
|
||||
component: SourceRoute,
|
||||
getParentRoute: () => dashboardRoute,
|
||||
path: "/sources/$sourceId",
|
||||
component: SourceRoute,
|
||||
})
|
||||
|
||||
function SourceRoute() {
|
||||
const { sourceId } = Route.useParams()
|
||||
const queryClient = useQueryClient()
|
||||
const { data: sources = [] } = useQuery({
|
||||
queryKey: ["sources"],
|
||||
queryFn: fetchSources,
|
||||
})
|
||||
const source = sources.find((s) => s.id === sourceId)
|
||||
const { sourceId } = Route.useParams()
|
||||
const queryClient = useQueryClient()
|
||||
const { data: sources = [] } = useQuery({
|
||||
queryKey: ["sources"],
|
||||
queryFn: fetchSources,
|
||||
})
|
||||
const source = sources.find((s) => s.id === sourceId)
|
||||
|
||||
if (!source) {
|
||||
return <p className="text-sm text-muted-foreground">Source not found.</p>
|
||||
}
|
||||
if (!source) {
|
||||
return <p className="text-sm text-muted-foreground">Source not found.</p>
|
||||
}
|
||||
|
||||
return (
|
||||
<SourceConfigPanel
|
||||
key={source.id}
|
||||
source={source}
|
||||
onUpdate={() => queryClient.invalidateQueries({ queryKey: ["configs"] })}
|
||||
/>
|
||||
)
|
||||
return (
|
||||
<SourceConfigPanel
|
||||
key={source.id}
|
||||
source={source}
|
||||
onUpdate={() => queryClient.invalidateQueries({ queryKey: ["configs"] })}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user