mirror of
https://github.com/bleackstorm/satiea.git
synced 2026-12-03 07:41:56 +01:00
feat(recipes): add AI recipe importer from URL, photo, text, and Android share sheet
This commit is contained in:
1 parent
0af8021bf2
commit
9b44e488fc
8 files changed
+1303
-2
No files matched your search
@@ -27,11 +27,13 @@ import androidx.compose.material.icons.automirrored.filled.MenuBook
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.AutoAwesome
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.Download
|
||||
import androidx.compose.material.icons.filled.People
|
||||
import androidx.compose.material.icons.filled.Schedule
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
import androidx.compose.material3.FilterChip
|
||||
import androidx.compose.material3.FilterChipDefaults
|
||||
import androidx.compose.material3.FloatingActionButton
|
||||
@@ -90,6 +92,7 @@ fun RecipesScreen(
|
||||
suggestionUiState: SuggestionUiState,
|
||||
savedSuggestionIds: Set<String>,
|
||||
onAddRecipeClick: () -> Unit,
|
||||
onImportRecipeClick: () -> Unit = {},
|
||||
onRecipeClick: (RecipeEntry) -> Unit,
|
||||
onSavePreference: (name: String, status: FoodPreferenceStatus, category: FoodCategory?) -> Unit,
|
||||
onRemovePreference: (slugId: String) -> Unit,
|
||||
@@ -252,6 +255,30 @@ fun RecipesScreen(
|
||||
onLikeRecipeIngredients = onLikeSuggestedRecipeIngredients
|
||||
)
|
||||
} else {
|
||||
// Quick Import Recipe banner (URL / Photo / Text)
|
||||
item {
|
||||
FilledTonalButton(
|
||||
onClick = onImportRecipeClick,
|
||||
shape = RoundedCornerShape(14.dp),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag("import_recipe_button")
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Download,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text(
|
||||
text = "Importer une recette (Lien, Photo ou Texte)",
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Search bar & Category filter chips
|
||||
if (recipes.isNotEmpty()) {
|
||||
item {
|
||||
|
||||
Reference in new issue
Block a user