Fix body change setting headers/method

This commit is contained in:
Gregory Schier
2024-08-09 08:33:49 -07:00
parent 0c9d532c1f
commit 6232a46ca8
4 changed files with 43 additions and 15 deletions

View File

@@ -55,7 +55,6 @@ export const placeholders = function (variables: { name: string }[]) {
}
const isFunction = groupMatch.includes('(');
console.log('VAIRABLES', variables, groupMatch);
return Decoration.replace({
inclusive: true,
widget: new PlaceholderWidget(

View File

@@ -15,10 +15,11 @@ export interface ToastProps {
className?: string;
timeout: number | null;
action?: ReactNode;
variant?: 'copied' | 'success' | 'info' | 'warning' | 'error';
variant?: 'custom' | 'copied' | 'success' | 'info' | 'warning' | 'error';
}
const ICONS: Record<NonNullable<ToastProps['variant']>, IconProps['icon']> = {
const ICONS: Record<NonNullable<ToastProps['variant']>, IconProps['icon'] | null> = {
custom: null,
copied: 'copyCheck',
warning: 'alert',
error: 'alert',
@@ -33,7 +34,7 @@ export function Toast({
onClose,
timeout,
action,
variant,
variant = 'info',
}: ToastProps) {
useKey(
'Escape',
@@ -45,6 +46,8 @@ export function Toast({
[open],
);
const icon = variant in ICONS && ICONS[variant];
return (
<motion.div
initial={{ opacity: 0, right: '-10%' }}
@@ -65,9 +68,9 @@ export function Toast({
)}
>
<div className="px-3 py-3 flex items-center gap-2">
{variant != null && (
{icon && (
<Icon
icon={ICONS[variant]}
icon={icon}
className={classNames(
variant === 'success' && 'text-fg-success',
variant === 'warning' && 'text-fg-warning',