-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tailwindcss and a simple table component
- Loading branch information
Showing
4 changed files
with
426 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ example | |
.DS_STORE | ||
|
||
example-server-bootstrap | ||
*.db | ||
db | ||
example | ||
example | ||
|
||
|
||
*_templ.go | ||
handoff.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package component | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/raphi011/handoff/internal/model" | ||
) | ||
|
||
templ TestRunTable(tsr model.TestSuiteRun) { | ||
<div class="px-4 sm:px-6 lg:px-8"> | ||
<div class="mt-8 flow-root"> | ||
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"> | ||
<div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"> | ||
<table class="min-w-full divide-y divide-gray-300"> | ||
<thead> | ||
<tr> | ||
<th scope="col" class="whitespace-nowrap py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-0">Name</th> | ||
<th scope="col" class="whitespace-nowrap px-2 py-3.5 text-left text-sm font-semibold text-gray-900">Status</th> | ||
<th scope="col" class="whitespace-nowrap px-2 py-3.5 text-left text-sm font-semibold text-gray-900">Duration</th> | ||
</tr> | ||
</thead> | ||
<tbody class="divide-y divide-gray-200 bg-white"> | ||
for _, tr := range tsr.TestResults { | ||
<tr> | ||
<td class="whitespace-nowrap py-2 pl-4 pr-3 text-sm text-gray-500 sm:pl-0"><a href={ templ.URL(fmt.Sprintf("/suites/%s/runs/%d/test/%s", tr.SuiteName, tsr.ID, tr.Name)) }>{ tr.Name }</a></td> | ||
<td class="whitespace-nowrap px-2 py-2 text-sm font-medium text-gray-900 flex items-center justify-start">if tr.Result == "passed" { | ||
<div class="flex-none rounded-full bg-green-400/10 p-1 text-green-400"> | ||
<div class="size-1.5 rounded-full bg-current"></div> | ||
</div> | ||
} else { | ||
<div class="flex-none rounded-full bg-rose-400/10 p-1 text-rose-400"> | ||
<div class="size-1.5 rounded-full bg-current"></div> | ||
</div> | ||
} | ||
if tr.SoftFailure { | ||
(soft failure) | ||
}</td> | ||
<td class="whitespace-nowrap px-2 py-2 text-sm text-gray-900">{ fmt.Sprintf("%dms", tr.DurationInMS) }</td> | ||
|
||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.