diff --git a/src/components/friend-card.astro b/src/components/friend-card.astro new file mode 100644 index 0000000..53df481 --- /dev/null +++ b/src/components/friend-card.astro @@ -0,0 +1,38 @@ +--- +interface Props { + name: string; + linkUri: string; +} + +const { name, linkUri } = Astro.props; + +function extractInitials(name: string) { + // Split the name into words + const words = name.split(" "); + + // Iterate over the words and extract the initials + const initials = words.map((word) => word.charAt(0).toUpperCase()).join(""); + + return initials; +} + +const initials = extractInitials(name); +const linkLabel = linkUri.replace(/^https?:\/\//, ""); +--- + +
{name}
+{linkLabel}
++ Folks I worked with, or I like what they do. +
+ +