feat: add stage 0 foundation
This commit is contained in:
19
frontend/src/components/app/AppPageHeader.tsx
Normal file
19
frontend/src/components/app/AppPageHeader.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import type * as React from 'react'
|
||||
|
||||
type AppPageHeaderProps = {
|
||||
title: string
|
||||
description?: string
|
||||
actions?: React.ReactNode
|
||||
}
|
||||
|
||||
export function AppPageHeader({ title, description, actions }: AppPageHeaderProps) {
|
||||
return (
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold tracking-normal text-foreground">{title}</h1>
|
||||
{description ? <p className="mt-1 text-sm text-muted-foreground">{description}</p> : null}
|
||||
</div>
|
||||
{actions ? <div className="flex items-center gap-2">{actions}</div> : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
13
frontend/src/components/app/AppPriorityBadge.tsx
Normal file
13
frontend/src/components/app/AppPriorityBadge.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
|
||||
const PRIORITY_LABELS: Record<string, string> = {
|
||||
low: '低',
|
||||
medium: '中',
|
||||
high: '高',
|
||||
urgent: '紧急'
|
||||
}
|
||||
|
||||
export function AppPriorityBadge({ priority }: { priority: string }) {
|
||||
const variant = priority === 'urgent' ? 'danger' : priority === 'high' ? 'warning' : 'default'
|
||||
return <Badge variant={variant}>{PRIORITY_LABELS[priority] ?? priority}</Badge>
|
||||
}
|
||||
15
frontend/src/components/app/AppStatusBadge.tsx
Normal file
15
frontend/src/components/app/AppStatusBadge.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
|
||||
const STATUS_LABELS: Record<string, string> = {
|
||||
pending_info: '待补充',
|
||||
pending: '待处理',
|
||||
in_progress: '处理中',
|
||||
pending_confirm: '待确认',
|
||||
resolved: '已解决',
|
||||
closed: '已关闭'
|
||||
}
|
||||
|
||||
export function AppStatusBadge({ status }: { status: string }) {
|
||||
const variant = status === 'resolved' || status === 'closed' ? 'success' : 'info'
|
||||
return <Badge variant={variant}>{STATUS_LABELS[status] ?? status}</Badge>
|
||||
}
|
||||
Reference in New Issue
Block a user