import { Action, ActionReason, ActionType } from '@supabase/shared-types/out/notifications' import Link from 'next/link' import { useRouter } from 'next/router' import { Fragment } from 'react' import { Button, IconExternalLink } from 'ui' import { Organization, Project } from 'types' interface NotificationActionsProps { project: Project organization: Organization changelogLink?: string availableActions: Action[] onSelectRestartProject: () => void onSelectApplyMigration: () => void onSelectRollbackMigration: () => void } const NotificationActions = ({ project, organization, changelogLink, availableActions, onSelectRestartProject, onSelectApplyMigration, onSelectRollbackMigration, }: NotificationActionsProps) => { const router = useRouter() const onSelectUpgradePlan = () => { return router.push(`/org/${organization.slug}/billing?panel=subscriptionPlan`) } const renderActionButton = (action: Action) => { switch (action.action_type) { case ActionType.UpgradeProjectToPro: return ( ) case ActionType.SchedulePostgresRestart: return ( ) case ActionType.MigratePostgresSchema: if (action.reason === ActionReason.Rollback) { return ( ) } else { return ( ) } } } return (