mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-10 17:26:38 +08:00
fix(frontend): keep browser API on same-origin rewrites in dev
Document that NEXT_PUBLIC_WAVELET_BACKEND_URL must stay unset for local next dev so axios hits /api/* and Next rewrites proxy to the backend.
This commit is contained in:
@@ -3,6 +3,7 @@ import { FileTextIcon } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
/**
|
||||
* 空状态展示组件属性
|
||||
@@ -55,6 +56,9 @@ export function EmptyState({
|
||||
className,
|
||||
iconSize = 'md',
|
||||
}: EmptyStateProps) {
|
||||
const t = useTranslations('layout.empty');
|
||||
const displayTitle = title ?? t('noData');
|
||||
const displayDescription = description ?? t('noContent');
|
||||
const iconSizes = { sm: 'size-10', md: 'size-12', lg: 'size-16' };
|
||||
const iconInnerSizes = { sm: 'size-5', md: 'size-6', lg: 'size-8' };
|
||||
|
||||
@@ -76,10 +80,14 @@ export function EmptyState({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{title && <h3 className='text-base font-medium mb-1'>{title}</h3>}
|
||||
{displayTitle && (
|
||||
<h3 className='text-base font-medium mb-1'>{displayTitle}</h3>
|
||||
)}
|
||||
|
||||
{description && (
|
||||
<p className='text-sm text-muted-foreground max-w-md'>{description}</p>
|
||||
{displayDescription && (
|
||||
<p className='text-sm text-muted-foreground max-w-md'>
|
||||
{displayDescription}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{onAction && actionText && (
|
||||
@@ -128,10 +136,12 @@ export function EmptyStateWithBorder(props: EmptyStateProps) {
|
||||
* @returns {React.ReactNode} 简化版空状态组件
|
||||
*/
|
||||
export function EmptyInline({
|
||||
message = '暂无数据',
|
||||
message,
|
||||
icon: Icon = FileTextIcon,
|
||||
className,
|
||||
}: Pick<EmptyStateProps, 'icon' | 'className'> & { message?: string }) {
|
||||
const t = useTranslations('layout.empty');
|
||||
const displayMessage = message ?? t('noData');
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
@@ -140,7 +150,7 @@ export function EmptyInline({
|
||||
)}
|
||||
>
|
||||
<Icon className='size-4' />
|
||||
<span>{message}</span>
|
||||
<span>{displayMessage}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user