managarten/picture/apps/mobile/components/ModelSelector.tsx
Till-JS c712a2504a feat: integrate uload and picture, unify package naming
- Add uload project with apps/web structure
  - Reorganize from flat to monorepo structure
  - Remove PocketBase binary and local data
  - Update to pnpm and @uload/web namespace

- Add picture project to monorepo
  - Remove embedded git repository

- Unify all package names to @{project}/{app} schema:
  - @maerchenzauber/* (was @storyteller/*)
  - @manacore/* (was manacore-*, manacore)
  - @manadeck/* (was web, backend, manadeck)
  - @memoro/* (was memoro-web, landing, memoro)
  - @picture/* (already unified)
  - @uload/web

- Add convenient dev scripts for all apps:
  - pnpm dev:{project}:web
  - pnpm dev:{project}:landing
  - pnpm dev:{project}:mobile
  - pnpm dev:{project}:backend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 04:00:36 +01:00

59 lines
1.3 KiB
TypeScript

import React from 'react';
import { OptionSelector, OptionItem } from './OptionSelector';
export type Model = {
id: string;
display_name: string;
version: string;
estimated_time_seconds: number;
description?: string;
};
type ModelSelectorProps = {
models: Model[];
selectedModel: Model | null;
onSelectModel: (model: Model) => void;
loading?: boolean;
error?: string | null;
onRetry?: () => void;
disabled?: boolean;
};
export function ModelSelector({
models,
selectedModel,
onSelectModel,
loading = false,
error = null,
onRetry,
disabled = false,
}: ModelSelectorProps) {
// Convert models to OptionItems
const options: OptionItem[] = models.map(model => ({
id: model.id,
label: model.display_name,
subtitle: `~${model.estimated_time_seconds}s`,
description: model.description,
}));
// Handle selection
const handleSelect = (option: OptionItem) => {
const model = models.find(m => m.id === option.id);
if (model) {
onSelectModel(model);
}
};
return (
<OptionSelector
options={options}
selectedId={selectedModel?.id || null}
onSelect={handleSelect}
loading={loading}
error={error}
onRetry={onRetry}
disabled={disabled}
title="Modell"
/>
);
}