mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
* sidebar-manager * storage keys * tests * more ai spots * test fix * revert to default * remove ref * Update apps/studio/state/sidebar-manager-state.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix ts * fix * fux * fux query param * clean * fix * more * mock local storage * simplify * remove provider test * remve useopensidebar * fix(new homepage): open ai assistant on advisor card button clicks * Update apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/studio/state/sidebar-manager-state.tsx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * refine * editor sidebar manager * reset results * advisor sidebar manager * empty state and notice * event tracking * remove variable * remove use effect * open in sidebar * use sidebar old home * Update apps/studio/components/ui/EditorPanel/EditorPanel.tsx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * connect hotkey * Update apps/studio/components/layouts/AppLayout/AssistantButton.tsx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/studio/state/advisor-state.ts Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/studio/state/advisor-state.ts Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * fix * initial prompt * fix(inline editor button): only show keyboard shortcut if hotkey active * cleanup(advisor panel): minor code cleanup * fix(advisor panel): misplaced key on list * fix(advisor panel): add error state * fix(advisor panel): improve a11y * fix(advisor panel): cannot find selected item * fix * fix * tooltip * link * sidebar move up * merge inbox * project/org sidebars * panels * clean * fix use effect * layoutheader export * fix * ts * prettier * tests * remove markdown * remove org and project filters from state * text link * Update apps/studio/state/sidebar-manager-state.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix * prettier * remove files * bump limit * noop * format * remove notifications on self hosted --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com> Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import LintDetail from 'components/interfaces/Linter/LintDetail'
|
|
import { Lint } from 'data/lint/lint-query'
|
|
import { Notification } from 'data/notifications/notifications-v2-query'
|
|
import { noop } from 'lodash'
|
|
import { AdvisorItem } from './AdvisorPanelHeader'
|
|
import { NotificationDetail } from './NotificationDetail'
|
|
|
|
interface AdvisorDetailProps {
|
|
item: AdvisorItem
|
|
projectRef: string
|
|
onUpdateNotificationStatus?: (id: string, status: 'archived' | 'seen') => void
|
|
}
|
|
|
|
export const AdvisorDetail = ({
|
|
item,
|
|
projectRef,
|
|
onUpdateNotificationStatus = noop,
|
|
}: AdvisorDetailProps) => {
|
|
if (item.source === 'lint') {
|
|
const lint = item.original as Lint
|
|
return (
|
|
<div className="px-6 py-6">
|
|
<LintDetail lint={lint} projectRef={projectRef} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (item.source === 'notification') {
|
|
const notification = item.original as Notification
|
|
return (
|
|
<div className="px-6 py-6">
|
|
<NotificationDetail
|
|
notification={notification}
|
|
onUpdateStatus={onUpdateNotificationStatus}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return null
|
|
}
|