generated from cms/tibi-docs
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
export let persons: Page[]
|
||||
let boxes = persons.map((p) => p.personPreview.name)
|
||||
const sortByFirstName = (a, b) => {
|
||||
const nameA = a.name.split(" ")[0] // Extracts the first name from "First Last"
|
||||
const nameB = b.name.split(" ")[0]
|
||||
return nameA.localeCompare(nameB)
|
||||
const nameA = a?.name?.split(" ")[0] // Extracts the first name from "First Last"
|
||||
const nameB = b?.name?.split(" ")[0]
|
||||
return nameA?.localeCompare(nameB)
|
||||
}
|
||||
boxes = boxes.sort(sortByFirstName)
|
||||
$: console.log(boxes, "boxes", persons)
|
||||
</script>
|
||||
|
||||
<div class="boxList">
|
||||
|
||||
Reference in New Issue
Block a user