refactor: split sidebar callout from generic Alert primitive

Rename CalloutCard to SidebarCallout (it was always sidebar-specific) and
add a shadcn-style Alert primitive with info/success/warning/error variants
for inline use in screens. Replace the misused SidebarCallout in project
settings with Alert and surface the underlying RPC error message instead
of generic copy. Tune destructive color per theme to a calm tinted red.
This commit is contained in:
Mohamed Boudra
2026-04-26 13:16:24 +07:00
parent 88ea88162c
commit 291a124663
10 changed files with 296 additions and 170 deletions
@@ -9,22 +9,20 @@ import {
useState,
} from "react";
import {
type CalloutAction,
CalloutCard,
type CalloutCardProps,
type CalloutVariant,
} from "@/components/callout-card";
SidebarCallout,
type SidebarCalloutAction,
type SidebarCalloutProps,
type SidebarCalloutVariant,
} from "@/components/sidebar-callout";
import { useStableEvent } from "@/hooks/use-stable-event";
export type SidebarCalloutAction = CalloutAction;
export interface SidebarCalloutOptions {
id: string;
dismissalKey?: string;
title: string;
description?: ReactNode;
icon?: ReactNode;
variant?: CalloutVariant;
variant?: SidebarCalloutVariant;
actions?: readonly SidebarCalloutAction[];
dismissible?: boolean;
priority?: number;
@@ -218,7 +216,7 @@ export function SidebarCalloutViewport() {
return null;
}
const cardProps: CalloutCardProps = {
const cardProps: SidebarCalloutProps = {
title: activeCallout.title,
description: activeCallout.description,
icon: activeCallout.icon,
@@ -229,5 +227,5 @@ export function SidebarCalloutViewport() {
testID: activeCallout.testID,
};
return <CalloutCard {...cardProps} />;
return <SidebarCallout {...cardProps} />;
}