From fbfb055001fe0f4d63d27a7b8de9541e889bf376 Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Fri, 15 Aug 2025 13:50:17 +1000 Subject: [PATCH] remove item --- .../SQLEditorNavV2/SearchList.tsx | 96 ------------------- 1 file changed, 96 deletions(-) delete mode 100644 apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SearchList.tsx diff --git a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SearchList.tsx b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SearchList.tsx deleted file mode 100644 index 9c74944dbc9..00000000000 --- a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SearchList.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { Loader2 } from 'lucide-react' -import Link from 'next/link' -import { useMemo } from 'react' - -import { useParams } from 'common' -import InfiniteList from 'components/ui/InfiniteList' -import { useContentCountQuery } from 'data/content/content-count-query' -import { useContentInfiniteQuery } from 'data/content/content-infinite-query' -import { Content } from 'data/content/content-query' -import { SNIPPET_PAGE_LIMIT } from 'data/content/sql-folders-query' -import { cn, SQL_ICON } from 'ui' -import ShimmeringLoader from 'ui-patterns/ShimmeringLoader' - -interface SearchListProps { - search: string -} - -export const SearchList = ({ search }: SearchListProps) => { - const { ref: projectRef } = useParams() - - const { data, isLoading, hasNextPage, fetchNextPage, isFetchingNextPage } = - useContentInfiniteQuery( - { - projectRef, - type: 'sql', - limit: SNIPPET_PAGE_LIMIT, - name: search.length === 0 ? undefined : search, - }, - { keepPreviousData: true } - ) - - const { data: count } = useContentCountQuery( - { - projectRef, - cumulative: true, - type: 'sql', - name: search, - }, - { keepPreviousData: true } - ) - const totalNumber = (count as unknown as { count: number })?.count ?? 0 - - const snippets = useMemo(() => data?.pages.flatMap((page) => page.content), [data?.pages]) - - return ( -
- {isLoading ? ( -
- -
- ) : !!count ? ( -

- {totalNumber} result{totalNumber > 1 ? 's' : ''} found -

- ) : null} - {isLoading ? ( -
- - - -
- ) : ( - } - itemProps={{}} - getItemSize={() => 28} - hasNextPage={hasNextPage} - isLoadingNextPage={isFetchingNextPage} - onLoadNextPage={() => fetchNextPage()} - /> - )} -
- ) -} - -const SearchListItem = ({ snippet }: { snippet: Content }) => { - const { ref, id } = useParams() - const isSelected = snippet.id === id - return ( - svg]:fill-foreground [&>p]:text-foreground' - )} - href={`/project/${ref}/sql/${snippet.id}`} - > - -

{snippet.name}

- - ) -}