/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** * `FlavorImportPreview` — render an unpacked .iflv preview and offer * the three import strategies (merge / save as new / replace). * * Sits inside `FlavorDialog` when a preview is pending. Pure * presentational component; the dialog owns the busy state and the * outgoing actions. */ import { FilePlus, GitMerge } from 'lucide-react'; import type { UnpackedFlavor } from '@ifc-lite/extensions'; import { Button } from '@/components/ui/button'; interface FlavorImportPreviewProps { unpacked: UnpackedFlavor; busy: boolean; onCancel(): void; onMerge(): void; onSaveAsNew(): void; onReplace(): void; } export function FlavorImportPreview({ unpacked, busy, onCancel, onMerge, onSaveAsNew, onReplace, }: FlavorImportPreviewProps) { return (
Import preview
Name:{' '} {unpacked.flavor.name}
ID:{' '} {unpacked.flavor.id}
{unpacked.flavor.description && (
{unpacked.flavor.description}
)}
{unpacked.flavor.extensions.length} extensions ·{' '} {unpacked.flavor.lenses.length} lenses ·{' '} {unpacked.flavor.savedQueries.length} queries
{unpacked.summary && (
{unpacked.summary}
)}
); }