47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Edit, Save, X } from 'lucide-react';
|
|
|
|
interface EnterpriseInfoHeaderProps {
|
|
isEditing: boolean;
|
|
loading?: boolean;
|
|
onEdit: () => void;
|
|
onCancel: () => void;
|
|
onSave: () => void;
|
|
}
|
|
|
|
export function EnterpriseInfoHeader({
|
|
isEditing,
|
|
loading = false,
|
|
onEdit,
|
|
onCancel,
|
|
onSave
|
|
}: EnterpriseInfoHeaderProps) {
|
|
return (
|
|
<div className="flex items-center justify-between">
|
|
<div>
|
|
<h2 className="text-green-800">企业信息</h2>
|
|
<p className="text-muted-foreground">查看和管理本企业的完整注册信息</p>
|
|
</div>
|
|
{!isEditing ? (
|
|
<Button onClick={onEdit}>
|
|
<Edit className="w-4 h-4 mr-2" />
|
|
编辑信息
|
|
</Button>
|
|
) : (
|
|
<div className="flex gap-2">
|
|
<Button variant="outline" onClick={onCancel} disabled={loading}>
|
|
<X className="w-4 h-4 mr-2" />
|
|
取消
|
|
</Button>
|
|
<Button onClick={onSave} disabled={loading}>
|
|
<Save className="w-4 h-4 mr-2" />
|
|
{loading ? '保存中...' : '提交审核'}
|
|
</Button>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
} |