import { CheckCircle2, Loader2 } from 'lucide-react' import { useState } from 'react' import { Button, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_, cn } from 'ui' import { useProjectLintsQuery } from 'data/lint/lint-query' import { useSelectedProject } from 'hooks/misc/useSelectedProject' import Link from 'next/link' import { WarningIcon } from 'ui/src/components/StatusIcon' export const SecurityStatus = () => { const project = useSelectedProject() const [open, setOpen] = useState(false) const { data, isLoading } = useProjectLintsQuery({ projectRef: project?.ref }) const securityLints = (data ?? []).filter((lint) => lint.categories.includes('SECURITY')) const errorLints = securityLints.filter((lint) => lint.level === 'ERROR') const warnLints = securityLints.filter((lint) => lint.level === 'WARN') const noIssuesFound = errorLints.length === 0 && warnLints.length === 0 const totalIssues = securityLints.length return (
{noIssuesFound ? ( ) : ( )}
{noIssuesFound ? (

No security issues found

Keep monitoring Security Advisor for updates as your project grows.

) : (

{totalIssues} security issue{totalIssues > 1 ? 's' : ''} require {totalIssues > 1 ? '' : 's'}{' '} {errorLints.length > 0 ? 'urgent attention' : 'attention'}

Check the Security Advisor to address them

)}
) }