diff --git a/libs/tools/send/send-ui/src/index.ts b/libs/tools/send/send-ui/src/index.ts index 6ef8d54d41..fc7c87449d 100644 --- a/libs/tools/send/send-ui/src/index.ts +++ b/libs/tools/send/send-ui/src/index.ts @@ -1 +1,2 @@ export * from "./icons"; +export { NewSendDropdownComponent } from "./new-send-dropdown/new-send-dropdown.component"; diff --git a/libs/tools/send/send-ui/src/new-send-dropdown/new-send-dropdown.component.html b/libs/tools/send/send-ui/src/new-send-dropdown/new-send-dropdown.component.html new file mode 100644 index 0000000000..0766435e1c --- /dev/null +++ b/libs/tools/send/send-ui/src/new-send-dropdown/new-send-dropdown.component.html @@ -0,0 +1,14 @@ + + + + + {{ "sendTypeText" | i18n }} + + + + {{ "sendTypeFile" | i18n }} + + diff --git a/libs/tools/send/send-ui/src/new-send-dropdown/new-send-dropdown.component.ts b/libs/tools/send/send-ui/src/new-send-dropdown/new-send-dropdown.component.ts new file mode 100644 index 0000000000..1463b448a6 --- /dev/null +++ b/libs/tools/send/send-ui/src/new-send-dropdown/new-send-dropdown.component.ts @@ -0,0 +1,23 @@ +import { CommonModule } from "@angular/common"; +import { Component } from "@angular/core"; +import { Router, RouterLink } from "@angular/router"; + +import { JslibModule } from "@bitwarden/angular/jslib.module"; +import { SendType } from "@bitwarden/common/tools/send/enums/send-type"; +import { ButtonModule, MenuModule } from "@bitwarden/components"; + +@Component({ + selector: "tools-new-send-dropdown", + templateUrl: "new-send-dropdown.component.html", + standalone: true, + imports: [JslibModule, CommonModule, ButtonModule, RouterLink, MenuModule], +}) +export class NewSendDropdownComponent { + sendType = SendType; + + constructor(private router: Router) {} + + newItemNavigate(type: SendType) { + void this.router.navigate(["/add-send"], { queryParams: { type: type, isNew: true } }); + } +}