feat(create-link): add create link component and routing

This commit is contained in:
Jan K9f 2025-01-20 15:11:46 +01:00
commit 00a7688ef9
Signed by: jank
GPG key ID: 50620ADD22CD330B
8 changed files with 125 additions and 1 deletions

View file

@ -0,0 +1,29 @@
<div class="h-full mx-auto container">
<app-navbar></app-navbar>
<div class="h-full overflow-x-auto pt-10">
<div class="mx-auto card bg-base-100 w-96 shadow-xl">
<div class="card-body">
<h2 class="card-title">Create link</h2>
@if (requestFailed) {
<div role="alert" class="alert alert-error">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current" fill="none"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span>Something went wrong</span>
</div>
}
<form [formGroup]="createLinkForm">
<input formControlName="name" type="text" placeholder="Name"
class="mb-3 input input-bordered w-full max-w-xs" />
<input formControlName="link" type="url" placeholder="Link" class="input input-bordered w-full max-w-xs" />
</form>
<div class="card-actions justify-end">
<button class="btn btn-primary" (click)="submit()">Create</button>
</div>
</div>
</div>
</div>
</div>