From 45a699d2cac95a3cf3ed4f6337b24272be5c95a3 Mon Sep 17 00:00:00 2001 From: "Fabien F." <8136686+lostmind84@users.noreply.github.com> Date: Sat, 3 Oct 2026 22:37:00 +0200 Subject: [PATCH] feat: install a new Docker server from the install screen (Linux) The install commands ask coa_core::platform::flavor() once and hand a Docker install to src-tauri/src/docker_install.rs; the repack arm of each command is untouched (an early return and an extra optional parameter are all that changed in lib.rs). New command install_environment tells the screen the kind of server, the suggested folder (~/CoaServer) and why Docker cannot be used, if it cannot. On Linux the install screen shows the game data folder (used in place, read-only) and the server package (a folder or an address; there is no default address until a signed Linux package is published), and disables Install until both are given and Docker works. It shows Docker's own message with a "Check again" button when Docker is missing, stopped or not allowed for the user. The Windows screen is unchanged (checked side by side in the browser mock). A debug build (tauri dev) accepts another package key named in COA_DEV_TRUSTED_KEY, to try the installer on a package signed with a throwaway key; a release build always uses the embedded key. New text is English only for now (other languages fall back to it). --- crates/coa-core/src/lib.rs | 1 + crates/coa-core/src/platform.rs | 41 +++++++++++ docs/ARCHITECTURE.md | 11 ++- src-tauri/src/docker_install.rs | 125 ++++++++++++++++++++++++++++++++ src-tauri/src/lib.rs | 27 ++++++- src/dev/mock.ts | 1 + src/i18n/locales/en.ts | 8 ++ src/lib/api.ts | 15 +++- src/screens/InstallServer.tsx | 63 +++++++++++++--- 9 files changed, 276 insertions(+), 16 deletions(-) create mode 100644 crates/coa-core/src/platform.rs create mode 100644 src-tauri/src/docker_install.rs diff --git a/crates/coa-core/src/lib.rs b/crates/coa-core/src/lib.rs index b105692..6cd6d08 100644 --- a/crates/coa-core/src/lib.rs +++ b/crates/coa-core/src/lib.rs @@ -31,6 +31,7 @@ pub mod repair; pub mod schema_check; pub mod net; pub mod package; +pub mod platform; pub mod ra; pub mod allsettings; pub mod modules; diff --git a/crates/coa-core/src/platform.rs b/crates/coa-core/src/platform.rs new file mode 100644 index 0000000..d943aaa --- /dev/null +++ b/crates/coa-core/src/platform.rs @@ -0,0 +1,41 @@ +//! Which kind of server a new installation is on this computer. This is the one place where the host decides: a Windows +//! computer installs a repack, anything else installs a Docker server. The screens and the commands ask here and then +//! call the code of that kind, so no platform check is scattered through shared code. + +use serde::Serialize; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +#[serde(rename_all = "kebab-case")] +pub enum Flavor { + /// The CoA Repack: Windows executables supervised by the repack's launcher. + Repack, + /// MySQL, the auth server and the world server in Docker containers. + Docker, +} + +pub fn flavor() -> Flavor { + if cfg!(windows) { + Flavor::Repack + } else { + Flavor::Docker + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn the_host_decides_once() { + #[cfg(windows)] + assert_eq!(flavor(), Flavor::Repack); + #[cfg(not(windows))] + assert_eq!(flavor(), Flavor::Docker); + } + + #[test] + fn the_screens_read_the_flavor_as_a_plain_word() { + assert_eq!(serde_json::to_string(&Flavor::Repack).unwrap(), "\"repack\""); + assert_eq!(serde_json::to_string(&Flavor::Docker).unwrap(), "\"docker\""); + } +} diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 97c48b5..bef72b0 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -401,8 +401,15 @@ hand over to `coa_core::docker`; nothing else needed to change for start, stop, produces `Database/baseline` without anyone's live database. The migration checksums recorded in the base are those of files checked out on Windows (CRLF line endings, `core.autocrlf`): the SQL of the core, the modules and SQUID must be checked out the same way for the checksums to match, or every applied migration looks edited. -* **Not done yet**: wiring the installer into the screens, downloading the game data, updates, port conflict detection, - the firewall and exposure checks, the Wildcard realm profiles, and the client under Wine/Proton. +* **In the screens** the host is asked once per command (`coa_core::platform::flavor()`: repack on Windows, Docker + elsewhere) and the Docker half lives in `src-tauri/src/docker_install.rs`; the repack arm of each install command is the + code that was there. `install_environment` tells the install screen the kind of server, the suggested folder + (`~/CoaServer`) and why Docker cannot be used, if it cannot. On Docker the screen also asks for the game data folder and + the package, and there is no default package address until a signed Linux package is published. Packages are checked with + the embedded key; only a debug build (`tauri dev`) accepts another one, named in `COA_DEV_TRUSTED_KEY`, to try the + installer on a package signed with a throwaway key. +* **Not done yet**: downloading the game data, updates, port conflict detection, the firewall and exposure checks, the + Wildcard realm profiles, and the client under Wine/Proton. ### D14. Keeping Windows and Linux apart diff --git a/src-tauri/src/docker_install.rs b/src-tauri/src/docker_install.rs new file mode 100644 index 0000000..1768cfc --- /dev/null +++ b/src-tauri/src/docker_install.rs @@ -0,0 +1,125 @@ +//! The Linux (Docker) side of the install commands. `lib.rs` asks `coa_core::platform::flavor()` once per command and +//! calls this module for a Docker install; the code for a repack install stays where it was and is not changed by what +//! happens here. + +use std::path::{Path, PathBuf}; + +use coa_core::docker::{self, install as core_install, SystemDocker}; +use coa_core::download::Cancel; +use coa_core::install::{Preflight, Source}; +use coa_core::registry::Registry; +use coa_core::{Error, Result}; +use serde::Serialize; +use tauri::{AppHandle, Emitter, State}; + +use super::{blocking, data_dir, summary, AppState, InstallRequirements, ServerSummary, UiError}; + +/// What the install screen needs to know about this computer before it asks anything. +#[derive(Serialize)] +pub struct Environment { + pub flavor: coa_core::platform::Flavor, + pub default_dir: String, + /// Why Docker cannot be used (not installed, not running, no permission), in Docker's own words; none when it works. + pub docker_problem: Option, +} + +pub fn default_dir() -> String { + default_dir_in(std::env::var("HOME").ok().as_deref()) +} + +fn default_dir_in(home: Option<&str>) -> String { + match home.map(|h| h.trim_end_matches('/')).filter(|h| !h.is_empty()) { + Some(h) => format!("{h}/CoaServer"), + None => "/srv/coa".into(), + } +} + +pub fn docker_problem() -> Option { + docker::check_docker(&SystemDocker).err().map(|e| e.to_string()) +} + +pub fn environment() -> Environment { + Environment { flavor: coa_core::platform::flavor(), default_dir: default_dir(), docker_problem: docker_problem() } +} + +pub fn preflight(dest: &str, data: Option, needed: Option, registry: &Registry) -> Preflight { + // The size comes from the signed package list when the screen already has it; it is checked again at install time. + core_install::preflight(Path::new(dest), Path::new(data.as_deref().unwrap_or("")), needed.unwrap_or(1024 * 1024 * 1024), registry) +} + +/// The Linux package has no default address yet: it is published only after the maintainer has signed it. +pub fn package_source(custom: Option) -> Result { + let pick = custom.filter(|s| !s.trim().is_empty()).or_else(|| std::env::var("COA_PACKAGE_SOURCE").ok().filter(|s| !s.trim().is_empty())); + match pick { + Some(p) if p.to_ascii_lowercase().starts_with("http") => Ok(Source::Url(p)), + Some(p) => Ok(Source::Dir(PathBuf::from(p))), + None => Err(Error::Invalid("Choose the Linux server package (a folder or an address): none is published yet.".into())), + } +} + +/// The key a Linux package must be signed with. A debug build (`tauri dev`) may name another one in `COA_DEV_TRUSTED_KEY`, +/// to try the installer on a package signed with a throwaway key; a release build always uses the embedded key. +pub fn trusted_key() -> String { + #[cfg(debug_assertions)] + if let Ok(k) = std::env::var("COA_DEV_TRUSTED_KEY") { + if !k.trim().is_empty() { + return k.trim().to_string(); + } + } + coa_core::signing::EMBEDDED_PUBLIC_KEY.to_string() +} + +pub async fn requirements(package: Option) -> std::result::Result { + blocking(move || { + let (m, _) = coa_core::pkgsource::fetch_manifest(&package_source(package)?, &trusted_key())?; + let archive = m.archive.ok_or_else(|| Error::InvalidManifest("no archive".into()))?; + Ok(InstallRequirements { download_bytes: archive.parts.iter().map(|p| p.size).sum(), unpacked_bytes: archive.unpacked_size, version: m.version }) + }) + .await +} + +pub async fn install(app: AppHandle, state: State<'_, AppState>, dest: String, package: Option, data: Option) -> std::result::Result { + let source = package_source(package)?; + let data_dir_path = PathBuf::from(data.filter(|d| !d.trim().is_empty()).ok_or_else(|| Error::Invalid("Choose the folder that holds the game data.".into()))?); + let cancel = Cancel::default(); + *state.install_cancel.lock().map_err(|_| Error::Invalid("state poisoned".into()))? = Some(cancel.clone()); + let registry = Registry::at(data_dir().join("installs.json")); + let dest_path = PathBuf::from(dest); + let key = trusted_key(); + let result = tauri::async_runtime::spawn_blocking(move || { + core_install::install( + &core_install::Params { source, dest: dest_path, data_dir: data_dir_path, trusted_key: &key, registry: ®istry, cancel }, + &|step| { + let _ = app.emit("install-progress", step); + }, + ) + }) + .await; + if let Ok(mut c) = state.install_cancel.lock() { + *c = None; + } + let done = result.map_err(|e| Error::Invalid(e.to_string()))??; + Ok(summary(done.id, PathBuf::from(done.path))) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn the_default_folder_is_in_the_home_folder() { + assert_eq!(default_dir_in(Some("/home/ana")), "/home/ana/CoaServer"); + assert_eq!(default_dir_in(Some("/home/ana/")), "/home/ana/CoaServer"); + assert_eq!(default_dir_in(None), "/srv/coa"); + assert_eq!(default_dir_in(Some("")), "/srv/coa"); + } + + #[test] + fn a_linux_package_must_be_named_there_is_no_default() { + std::env::remove_var("COA_PACKAGE_SOURCE"); + assert!(package_source(None).is_err()); + assert!(package_source(Some(" ".into())).is_err()); + assert!(matches!(package_source(Some("/tmp/pkg".into())).unwrap(), Source::Dir(_))); + assert!(matches!(package_source(Some("https://example.org/pkg".into())).unwrap(), Source::Url(_))); + } +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index fa60d83..74eb209 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -5,11 +5,14 @@ use std::collections::HashSet; use std::path::PathBuf; use std::sync::Mutex; +mod docker_install; + use coa_core::backup::{self, Kind, RecoveryPoint, Trigger, VerifyReport}; use coa_core::config::{self, Scope, SettingsView}; use coa_core::download::Cancel; use coa_core::driver::{self, DriverOutcome, Verb}; use coa_core::install::{self, Preflight, Source}; +use coa_core::platform::{self, Flavor}; use coa_core::ra::Ra; use coa_core::update::{self, Resolution}; use coa_core::error::UiError; @@ -105,9 +108,19 @@ fn summary(id: String, path: PathBuf) -> ServerSummary { #[tauri::command] fn default_install_dir() -> String { + if platform::flavor() == Flavor::Docker { + return docker_install::default_dir(); + } "C:\\Games\\CoA Server".into() } +/// What the install screen needs to know about this computer: the kind of server it installs, the suggested folder, and +/// whether Docker can be used. +#[tauri::command] +async fn install_environment() -> docker_install::Environment { + tauri::async_runtime::spawn_blocking(docker_install::environment).await.unwrap_or_else(|_| docker_install::Environment { flavor: platform::flavor(), default_dir: default_install_dir(), docker_problem: None }) +} + #[tauri::command] async fn scan_server(path: String) -> std::result::Result { tauri::async_runtime::spawn_blocking(move || layout::scan(std::path::Path::new(&path))) @@ -450,7 +463,10 @@ async fn restore_backup_database(state: State<'_, AppState>, id: String, backup_ } #[tauri::command] -fn install_preflight(state: State<'_, AppState>, dest: String, needed: Option) -> Preflight { +fn install_preflight(state: State<'_, AppState>, dest: String, needed: Option, game_data: Option) -> Preflight { + if platform::flavor() == Flavor::Docker { + return docker_install::preflight(&dest, game_data, needed, &state.registry); + } // `needed` is the real size from the signed package list when the screen already has it; the real size is checked // again at install time either way. install::preflight(std::path::Path::new(&dest), needed.unwrap_or(6 * 1024 * 1024 * 1024), &state.registry) @@ -468,6 +484,9 @@ struct InstallRequirements { /// How big the server is, read from the package's signed list before anything is downloaded. #[tauri::command] async fn install_requirements(package: Option) -> std::result::Result { + if platform::flavor() == Flavor::Docker { + return docker_install::requirements(package).await; + } blocking(move || { let (m, _) = coa_core::pkgsource::fetch_manifest(&package_source(package), coa_core::signing::EMBEDDED_PUBLIC_KEY)?; let archive = m.archive.ok_or_else(|| Error::InvalidManifest("no archive".into()))?; @@ -477,7 +496,10 @@ async fn install_requirements(package: Option) -> std::result::Result, dest: String, package: Option) -> std::result::Result { +async fn install_new(app: AppHandle, state: State<'_, AppState>, dest: String, package: Option, game_data: Option) -> std::result::Result { + if platform::flavor() == Flavor::Docker { + return docker_install::install(app, state, dest, package, game_data).await; + } let cancel = Cancel::default(); *state.install_cancel.lock().map_err(|_| Error::Invalid("state poisoned".into()))? = Some(cancel.clone()); let source = package_source(package); @@ -1590,6 +1612,7 @@ pub fn run() { .manage(AppState { registry: Registry::at(dir.join("installs.json")), busy: Mutex::new(HashSet::new()), install_cancel: Mutex::new(None), client_cancel: Mutex::new(None) }) .invoke_handler(tauri::generate_handler![ default_install_dir, + install_environment, scan_server, add_server, list_servers, diff --git a/src/dev/mock.ts b/src/dev/mock.ts index cba1688..0faa305 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -91,6 +91,7 @@ export {}; if(cmd==="report_targets") return [{id:"manager",repo:"Corfirean/coa-server-manager",ours:true},{id:"companions",repo:"Corfirean/mod-coa-playerbots",ours:true},{id:"squid",repo:"Zyth45/mod-playerbots",ours:false}]; if(cmd==="open_link"){(window as any).__lastLink=args.url;return null;} if(cmd==="export_diagnostics") return "C:\\Users\\you\\Desktop\\CoA-Diagnostics-20261001-140000.zip"; + if(cmd==="install_environment"){const docker=new URLSearchParams(location.search).get("flavor")==="docker";return docker?{flavor:"docker",default_dir:"/home/you/CoaServer",docker_problem:new URLSearchParams(location.search).has("nodocker")?"permission denied while trying to connect to the Docker daemon socket":null}:{flavor:"repack",default_dir:"C:\\Games\\CoA Server",docker_problem:null};} if(cmd==="install_preflight") return {ok:true,problems:[],free_bytes:210*2**30}; if(cmd==="install_requirements") return {download_bytes:Math.round(5.9*2**30),unpacked_bytes:Math.round(11.4*2**30),version:"0.2.0"}; if(cmd==="list_accounts"){const w=window as any;w.__acc=w.__acc??[{id:2,name:"ALICE",access:3,online:true,last_login:"2026-10-01 12:04:11",characters:4},{id:5,name:"BOB",access:0,online:false,last_login:null,characters:0},{id:6,name:"CAROL",access:2,online:false,last_login:"2026-09-30 21:40:02",characters:2}];return w.__acc;} diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 4354787..cf09f90 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -190,6 +190,14 @@ const en = { "install.localPkg": "Install from a local package folder instead of downloading", "install.localPkgHint": "(leave empty to download)", "install.button": "Install", + "install.docker.title": "Docker is needed", + "install.docker.text": "On Linux the server runs in Docker. Install Docker and start it, or allow your user to use it, then check again.", + "install.docker.retry": "Check again", + "install.data.label": "Game data folder", + "install.data.hint": "The folder with the game's dbc, maps, vmaps and mmaps. It is used where it is and never changed.", + "install.data.dialogTitle": "Choose the game data folder", + "install.linuxPkg.label": "Server package", + "install.linuxPkg.hint": "A folder or an address of the Linux server package", "install.progressTitle": "Preparing your server", "install.progressText": "This can take a few minutes. You can leave this window open.", "install.step.checking": "Checking your computer", diff --git a/src/lib/api.ts b/src/lib/api.ts index b580709..0116456 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -265,6 +265,16 @@ export interface ReportTarget { ours: boolean; } +/** The kind of server this computer installs: a repack (Windows) or Docker containers (Linux). */ +export type Flavor = "repack" | "docker"; + +export interface InstallEnvironment { + flavor: Flavor; + default_dir: string; + /** Why Docker cannot be used, in its own words; null when it works. */ + docker_problem: string | null; +} + export interface InstallRequirements { download_bytes: number; unpacked_bytes: number; @@ -454,7 +464,8 @@ export const api = { deleteBackup: (id: string, backupId: string) => invoke("delete_backup", { id, backupId }), restoreConfigs: (id: string, backupId: string) => invoke("restore_backup_configs", { id, backupId }), restoreDatabase: (id: string, backupId: string, database: string) => invoke("restore_backup_database", { id, backupId, database }), - installPreflight: (dest: string, needed?: number) => invoke("install_preflight", { dest, needed: needed ?? null }), + installEnvironment: () => invoke("install_environment"), + installPreflight: (dest: string, needed?: number, gameData?: string) => invoke("install_preflight", { dest, needed: needed ?? null, gameData: gameData ?? null }), installRequirements: (pkg?: string) => invoke("install_requirements", { package: pkg ?? null }), realmlistProfiles: (id: string) => invoke<{ profiles: RealmProfile[]; active: string | null }>("realmlist_profiles", { id }), realmlistSave: (id: string, profileId: string | null, name: string, data: string) => invoke("realmlist_save", { id, profileId, name, data }), @@ -473,7 +484,7 @@ export const api = { accountSetAccess: (id: string, name: string, level: number) => invoke("account_set_access", { id, name, level }), accountRename: (id: string, name: string, newName: string, password: string) => invoke("account_rename", { id, name, newName, password }), accountDelete: (id: string, name: string) => invoke("account_delete", { id, name }), - installNew: (dest: string, pkg?: string) => invoke("install_new", { dest, package: pkg ?? null }), + installNew: (dest: string, pkg?: string, gameData?: string) => invoke("install_new", { dest, package: pkg ?? null, gameData: gameData ?? null }), cancelInstall: () => invoke("cancel_install"), createAccount: (id: string, username: string, password: string, administrator: boolean) => invoke("create_account", { id, username, password, administrator }), diff --git a/src/screens/InstallServer.tsx b/src/screens/InstallServer.tsx index c9f92f8..230c5c4 100644 --- a/src/screens/InstallServer.tsx +++ b/src/screens/InstallServer.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; import { listen } from "@tauri-apps/api/event"; import { open } from "@tauri-apps/plugin-dialog"; import { Check, ChevronDown, ChevronRight, Loader2 } from "lucide-react"; -import { api, asUiError, type InstallRequirements, type InstallStep, type Preflight, type ServerSummary, type UiError } from "@/lib/api"; +import { api, asUiError, type InstallEnvironment, type InstallRequirements, type InstallStep, type Preflight, type ServerSummary, type UiError } from "@/lib/api"; import { formatBytes } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; @@ -33,6 +33,19 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void; const [pkg, setPkg] = useState(""); const [installed, setInstalled] = useState(null); const [showDetails, setShowDetails] = useState(false); + // What this computer installs. A repack (Windows) needs nothing more than a folder; Docker (Linux) also needs the game data + // folder and a package, and Docker itself. + const [env, setEnv] = useState(null); + const [gameData, setGameData] = useState(""); + const docker = env?.flavor === "docker"; + + function loadEnvironment(first: boolean) { + void api.installEnvironment().then((e) => { + setEnv(e); + if (first && e.flavor === "docker") setDest(e.default_dir); + }).catch(() => setEnv(null)); + } + useEffect(() => loadEnvironment(true), []); // how big the server is, from the package's signed list (re-read when another package source is entered) useEffect(() => { @@ -43,9 +56,9 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void; // room for the unpacked server plus the download that is removed afterwards const needed = req ? req.unpacked_bytes + req.download_bytes : undefined; useEffect(() => { - const timer = setTimeout(() => void api.installPreflight(dest, needed).then(setPre).catch(() => setPre(null)), 250); + const timer = setTimeout(() => void api.installPreflight(dest, needed, docker ? gameData.trim() : undefined).then(setPre).catch(() => setPre(null)), 250); return () => clearTimeout(timer); - }, [dest, needed]); + }, [dest, needed, docker, gameData]); useEffect(() => { const un = listen("install-progress", (e) => setStep(e.payload)); @@ -56,7 +69,12 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void; async function browse() { const picked = await open({ directory: true, multiple: false, title: t("install.dialogTitle") }); - if (typeof picked === "string") setDest(picked.replace(/[\\/]+$/, "") + (picked.toLowerCase().includes("coa") ? "" : "\\CoA Server")); + if (typeof picked === "string") setDest(picked.replace(/[\\/]+$/, "") + (picked.toLowerCase().includes("coa") ? "" : docker ? "/CoaServer" : "\\CoA Server")); + } + + async function browseGameData() { + const picked = await open({ directory: true, multiple: false, title: t("install.data.dialogTitle") }); + if (typeof picked === "string") setGameData(picked); } async function browsePackage() { @@ -69,7 +87,7 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void; setPhase("installing"); setStep({ step: "Preparing your server", percent: 0, detail: null }); try { - const s = await api.installNew(dest, pkg.trim() || undefined); + const s = await api.installNew(dest, pkg.trim() || undefined, docker ? gameData.trim() : undefined); setInstalled(s); setPhase("done"); } catch (e) { @@ -139,9 +157,34 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void; - {pre && pre.problems.length > 0 && ( + {docker && ( +
+ +
+ setGameData(e.target.value)} className="selectable flex-1 rounded-md border border-line bg-card px-3 py-2.5 text-[15px] outline-none focus:border-gold" /> + +
+

{t("install.data.hint")}

+ +
+ setPkg(e.target.value)} placeholder={t("install.linuxPkg.hint")} className="selectable flex-1 rounded-md border border-line bg-card px-3 py-2.5 text-[15px] outline-none focus:border-gold" /> + +
+
+ )} + + {docker && env?.docker_problem && ( - {pre.problems.map((p) => ( +

{t("install.docker.title")}

+

{t("install.docker.text")}

+
{env.docker_problem}
+ +
+ )} + + {pre && pre.problems.some((p) => !(docker && !gameData.trim() && p.code.startsWith("data"))) && ( + + {pre.problems.filter((p) => !(docker && !gameData.trim() && p.code.startsWith("data"))).map((p) => (

{p.message}

))}
@@ -170,7 +213,7 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void; )} -
+ {!docker &&
)} - + }
- {props.canCancel && (