managarten/picture/apps/mobile/components/AspectRatioSelector.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

50 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import { OptionSelector, OptionItem } from './OptionSelector';
export type AspectRatio = {
label: string;
value: string;
width: number;
height: number;
icon: string;
};
type AspectRatioSelectorProps = {
aspectRatios: AspectRatio[];
selectedAspectRatio: AspectRatio;
onSelectAspectRatio: (ratio: AspectRatio) => void;
disabled?: boolean;
};
export function AspectRatioSelector({
aspectRatios,
selectedAspectRatio,
onSelectAspectRatio,
disabled = false,
}: AspectRatioSelectorProps) {
// Convert aspect ratios to OptionItems
const options: OptionItem[] = aspectRatios.map(ratio => ({
id: ratio.value,
label: ratio.label,
subtitle: `${ratio.width}×${ratio.height}`,
}));
// Handle selection
const handleSelect = (option: OptionItem) => {
const ratio = aspectRatios.find(r => r.value === option.id);
if (ratio) {
onSelectAspectRatio(ratio);
}
};
return (
<OptionSelector
options={options}
selectedId={selectedAspectRatio.value}
onSelect={handleSelect}
disabled={disabled}
minWidth={80}
title="Seitenverhältnis"
/>
);
}