feat(ui): refina detalhes do evento e aprovação de usuários
- Dashboard: Ajusta exibição do campo LOCAL para mostrar o nome do local. - Dashboard: Atualiza exibição do ENDEREÇO para formato completo. - UserApproval: Remove funcionalidade e botão de rejeitar usuários.
This commit is contained in:
parent
0e3e74eb59
commit
8bea8d1162
3 changed files with 6 additions and 30 deletions
|
|
@ -1051,7 +1051,7 @@ export const EventForm: React.FC<EventFormProps> = ({
|
|||
</p>
|
||||
</div>
|
||||
|
||||
{formData.files.length > 0 && (
|
||||
{(formData.files || []).length > 0 && (
|
||||
<div className="space-y-2">
|
||||
<h4 className="text-sm font-medium text-gray-700">
|
||||
Arquivos Selecionados:
|
||||
|
|
|
|||
|
|
@ -546,8 +546,7 @@ export const Dashboard: React.FC<DashboardProps> = ({
|
|||
Local
|
||||
</td>
|
||||
<td className="px-4 py-3 text-sm text-gray-900">
|
||||
{selectedEvent.address.street},{" "}
|
||||
{selectedEvent.address.number}
|
||||
{(selectedEvent as any).local_evento || (selectedEvent as any).locationName || "-"}
|
||||
</td>
|
||||
</tr>
|
||||
<tr className="hover:bg-gray-50">
|
||||
|
|
@ -555,10 +554,8 @@ export const Dashboard: React.FC<DashboardProps> = ({
|
|||
Endereço
|
||||
</td>
|
||||
<td className="px-4 py-3 text-sm text-gray-900">
|
||||
{selectedEvent.address.city} -{" "}
|
||||
{selectedEvent.address.state}
|
||||
{selectedEvent.address.zip &&
|
||||
` | CEP: ${selectedEvent.address.zip}`}
|
||||
{selectedEvent.address.street}, {selectedEvent.address.number} - {selectedEvent.address.city}/{selectedEvent.address.state}
|
||||
{selectedEvent.address.zip && ` | CEP: ${selectedEvent.address.zip}`}
|
||||
</td>
|
||||
</tr>
|
||||
<tr className="hover:bg-gray-50">
|
||||
|
|
|
|||
|
|
@ -81,19 +81,7 @@ export const UserApproval: React.FC<UserApprovalProps> = ({ onNavigate }) => {
|
|||
}
|
||||
};
|
||||
|
||||
const handleReject = async (userId: string) => {
|
||||
if (!token) return;
|
||||
setIsProcessing(userId);
|
||||
try {
|
||||
await apiRejectUser(userId, token);
|
||||
await fetchUsers();
|
||||
} catch (error) {
|
||||
console.error("Erro ao rejeitar usuário:", error);
|
||||
alert("Erro ao rejeitar usuário");
|
||||
} finally {
|
||||
setIsProcessing(null);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Separar usuários Clientes (EVENT_OWNER) e Profissionais (PHOTOGRAPHER)
|
||||
// Backend roles: PHOTOGRAPHER, EVENT_OWNER, BUSINESS_OWNER, SUPERADMIN
|
||||
|
|
@ -336,16 +324,7 @@ export const UserApproval: React.FC<UserApprovalProps> = ({ onNavigate }) => {
|
|||
<CheckCircle className="w-4 h-4 mr-1" />
|
||||
Aprovar
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => handleReject(user.id)}
|
||||
isLoading={isProcessing === user.id}
|
||||
disabled={isProcessing !== null}
|
||||
className="bg-red-600 hover:bg-red-700 text-white"
|
||||
>
|
||||
<XCircle className="w-4 h-4 mr-1" />
|
||||
Rejeitar
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Reference in a new issue