mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Context This is largely just a mechanical change here: Opting to use lucide icons with the `Icon` suffix across all icon imports within `studio` - so that it’s clearer which components are icons + reduces the possibility of name collision with our own components - e.g <User /> vs <UserIcon /> Also added a eslint rule for this: <img width="1069" height="167" alt="image" src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc" /> And updated `AGENTS.md` as such: ``` Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced). ```
96 lines
2.7 KiB
TypeScript
96 lines
2.7 KiB
TypeScript
import { LOCAL_STORAGE_KEYS } from 'common'
|
|
import { XIcon } from 'lucide-react'
|
|
import { Button, cn } from 'ui'
|
|
|
|
import { Markdown } from '../Markdown'
|
|
import { ShortcutTooltip } from '@/components/ui/ShortcutTooltip'
|
|
import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'
|
|
import { DOCS_URL } from '@/lib/constants'
|
|
import { SHORTCUT_IDS } from '@/state/shortcuts/registry'
|
|
|
|
interface LinterPageFooterProps {
|
|
isLoading: boolean
|
|
isRefetching: boolean
|
|
refetch: () => void
|
|
hideDbInspectCTA?: boolean
|
|
}
|
|
|
|
export const LinterPageFooter = ({
|
|
isLoading,
|
|
isRefetching,
|
|
refetch,
|
|
hideDbInspectCTA,
|
|
}: LinterPageFooterProps) => {
|
|
const [showBottomSection, setShowBottomSection] = useLocalStorageQuery(
|
|
LOCAL_STORAGE_KEYS.LINTER_SHOW_FOOTER,
|
|
true
|
|
)
|
|
|
|
if (!showBottomSection) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<div className="px-6 py-6 flex gap-x-4 border-t relative">
|
|
<Button
|
|
className="absolute top-1.5 right-3 px-1.5"
|
|
variant="text"
|
|
size="tiny"
|
|
onClick={() => setShowBottomSection(false)}
|
|
>
|
|
<XIcon size="14" />
|
|
</Button>
|
|
<div
|
|
className={cn(hideDbInspectCTA ? 'w-[35%]' : 'w-[33%]', 'flex flex-col gap-y-1 text-sm')}
|
|
>
|
|
<p>Reset suggestions</p>
|
|
<p className="text-xs text-foreground-light">
|
|
Consider resetting the analysis after making any changes
|
|
</p>
|
|
|
|
<ShortcutTooltip
|
|
shortcutId={SHORTCUT_IDS.ADVISORS_REFRESH}
|
|
label="Rerun linter"
|
|
side="bottom"
|
|
align="start"
|
|
>
|
|
<Button
|
|
className="mt-3! w-min"
|
|
disabled={isLoading || isRefetching}
|
|
loading={isLoading || isRefetching}
|
|
onClick={() => refetch()}
|
|
>
|
|
Rerun linter
|
|
</Button>
|
|
</ShortcutTooltip>
|
|
</div>
|
|
|
|
<div
|
|
className={cn(hideDbInspectCTA ? 'w-[35%]' : 'w-[33%]', 'flex flex-col gap-y-1 text-sm')}
|
|
>
|
|
<p>How are these suggestions generated?</p>
|
|
<div className="prose text-xs">
|
|
<p>
|
|
<span>These suggestions use </span>
|
|
<a href="https://github.com/supabase/splinter" target="" rel="">
|
|
splinter (Supabase Postgres LINTER)
|
|
</a>
|
|
.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
{!hideDbInspectCTA && (
|
|
<div className="w-[33%] flex flex-col gap-y-1 text-sm">
|
|
<p>Inspect your database for potential issues</p>
|
|
<Markdown
|
|
className="text-xs"
|
|
content={`The Supabase CLI comes with a range of tools to help inspect your Postgres instances for
|
|
potential issues. [Learn more here](${DOCS_URL}/guides/observability/inspect).`}
|
|
/>
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|