refactor(ui): drawer replica filter uses DS Select

This commit is contained in:
hsiegeln
2026-04-23 16:13:54 +02:00
parent f31975e0ef
commit e00848dc65
2 changed files with 17 additions and 9 deletions

View File

@@ -49,6 +49,12 @@
font-size: 12px;
}
.replicaLabel {
display: inline-flex;
align-items: center;
gap: 8px;
}
.emptyState {
padding: 16px;
color: var(--text-muted);

View File

@@ -1,4 +1,5 @@
import { useMemo, useState } from 'react';
import { Select } from '@cameleer/design-system';
import { useInfiniteApplicationLogs } from '../../../../api/queries/logs';
import type { Deployment } from '../../../../api/queries/admin/apps';
import { instanceIdsFor } from './instance-id';
@@ -28,23 +29,24 @@ export function LogsPanel({ deployment, appSlug, envSlug }: Props) {
isAtTop: true,
});
const replicaOptions = [
{ value: 'all', label: `all (${deployment.replicaStates.length})` },
...deployment.replicaStates.map((_, i) => ({ value: String(i), label: String(i) })),
];
return (
<div>
<div className={styles.filterBar}>
<label>
Replica:&nbsp;
<select
<label className={styles.replicaLabel}>
<span>Replica:</span>
<Select
value={String(replicaFilter)}
onChange={(e) => {
const v = e.target.value;
setReplicaFilter(v === 'all' ? 'all' : Number(v));
}}
>
<option value="all">all ({deployment.replicaStates.length})</option>
{deployment.replicaStates.map((_, i) => (
<option key={i} value={i}>{i}</option>
))}
</select>
options={replicaOptions}
/>
</label>
</div>
{logs.items.length === 0 && !logs.isLoading && (