32 lines
937 B
React
32 lines
937 B
React
|
|
export function ActorSelect({ actors = [], defaultSelected = [], label = 'Zugewiesene Actors' }) {
|
||
|
|
if (!actors.length) {
|
||
|
|
return (
|
||
|
|
<p className="muted actor-select-hint">
|
||
|
|
Kein Actor verfügbar — bitte TenantContext prüfen.
|
||
|
|
</p>
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
return (
|
||
|
|
<fieldset className="actor-select">
|
||
|
|
<legend>{label}</legend>
|
||
|
|
{actors.map((actor) => (
|
||
|
|
<label key={actor.id} className="checkbox-label">
|
||
|
|
<input
|
||
|
|
type="checkbox"
|
||
|
|
name={`actor_${actor.id}`}
|
||
|
|
defaultChecked={defaultSelected.includes(actor.id)}
|
||
|
|
/>
|
||
|
|
{actor.name}
|
||
|
|
{actor.actor_type && <span className="muted"> ({actor.actor_type})</span>}
|
||
|
|
</label>
|
||
|
|
))}
|
||
|
|
{actors.length === 1 && (
|
||
|
|
<p className="muted actor-select-hint">
|
||
|
|
AP0.6: Nur der aktuelle Actor — Tenant-Actor-Liste folgt in AP0.7.
|
||
|
|
</p>
|
||
|
|
)}
|
||
|
|
</fieldset>
|
||
|
|
)
|
||
|
|
}
|