re:Theme
A collection of reimagined themes that I like, but felt are not completed. re:Themes is my way of bringing a form of completion to those themes while also adding my own flare to them.
A collection of reimagined themes that I like, but felt are not completed. re:Themes is my way of bringing a form of completion to those themes while also adding my own flare to them.
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| — | #ebdbb2 | — |
| emphasis | — | italic |
| strong | — | bold |
| header | #458588 | — |
| comment, punctuation.definition.comment | #928374 | italic |
| constant, support.constant, variable.arguments | #d3869b | — |
| constant.rgb-value | #ebdbb2 | — |
| entity.name.selector | #8ec07c | — |
| entity.other.attribute-name | #fe8019 | — |
| entity.name.tag, punctuation.tag | #83a598 | — |
| invalid, invalid.illegal | #cc241d | — |
| invalid.deprecated | #b16286 | — |
| meta.selector | #8ec07c | — |
| meta.preprocessor | #fe8019 | — |
| meta.preprocessor.string | #b8bb26 | — |
| meta.preprocessor.numeric | #b8bb26 | — |
| meta.header.diff | #fe8019 | — |
| storage | #fe8019 | — |
| storage.modifier | #fe8019 | — |
| string | #b8bb26 | — |
| string.tag | #b8bb26 | — |
| string.value | #b8bb26 | — |
| string.regexp | #fe8019 | — |
| string.escape | #fb4934 | — |
| string.quasi | #8ec07c | — |
| string.entity | #b8bb26 | — |
| object | #ebdbb2 | — |
| module.node | #83a598 | — |
| support.type.property-name | #689d6a | — |
| keyword | #fb4934 | — |
| keyword.control | #fb4934 | — |
| keyword.control.module | #8ec07c | — |
| keyword.control.less | #d79921 | — |
| keyword.operator | #8ec07c | — |
| keyword.operator.new | #fe8019 | — |
| keyword.other.unit | #b8bb26 | — |
| metatag.php | #fe8019 | — |
| support.function.git-rebase | #689d6a | — |
| constant.sha.git-rebase | #b8bb26 | — |
| meta.type.name, meta.return.type, meta.return-type, meta.cast, meta.type.annotation, support.type, storage.type.cs, variable.class | #fabd2f | — |
| variable.this, support.variable | #d3869b | — |
| entity.name, entity.static, entity.name.class.static.function, entity.name.function, entity.name.class, entity.name.type | #EBD6AD | — |
| storage.type.function, entity.function, entity.name.function.static | #fabd2f | — |
| entity.name.function.function-call | #8ec07c | — |
| support.function.builtin | #fe8019 | — |
| entity.name.method, entity.name.method.function-call, entity.name.static.function-call | #689d6a | — |
| brace | #d5c4a1 | — |
| meta.parameter.type.variable, variable.parameter, variable.name, variable.other, variable, string.constant.other.placeholder | #EBD6AD | — |
| entity.name.function | #Fabd2f | — |
| prototype | #d3869b | — |
| storage.type.class | #fb4934 | — |
| punctuation | #a89984 | — |
| punctuation.quoted | #ebdbb2 | — |
| punctuation.quasi | #fb4934 | — |
| *url*, *link*, *uri* | — | underline |
| meta.function.python, entity.name.function.python | #8ec07c | — |
| storage.type.function.python, storage.modifier.declaration, storage.type.class.python | #fb4934 | — |
| meta.function-call.generic | #83a598 | — |
| meta.function-call.arguments | #d5c4a1 | — |
| entity.name.function.decorator | #fabd2f | bold |
| constant.other.caps | — | bold |
| keyword.operator.logical | #fb4934 | — |
| punctuation.definition.logical-expression | #fe8019 | — |
| string.inperpolated.dollar.shell | #fe8019 | — |
| string.interpolated.dollar.shell, string.interpolated.backtick.shell | #8ec07c | — |
| keyword.control.directive | #8ec07c | — |
| support.function.C99 | #fabd2f | — |
| meta.function.cs, entity.name.function.cs, entity.name.type.namespace.cs | #b8bb26 | — |
| keyword.other.using.cs, entity.name.variable.field.cs, entity.name.variable.local.cs, variable.other.readwrite.cs | #8ec07c | — |
| keyword.other.this.cs, keyword.other.base.cs | #d3869b | — |
| meta.scope.prerequisites | #fabd2f | — |
| entity.name.function.target | #b8bb26 | bold |
| storage.modifier.import.java, storage.modifier.package.java | #bdae93 | — |
| keyword.other.import.java, keyword.other.package.java | #8ec07c | — |
| storage.type.java | #fabd2f | — |
| storage.type.annotation | #83a598 | bold |
| keyword.other.documentation.javadoc | #8ec07c | — |
| comment.block.javadoc variable.parameter.java | #b8bb26 | bold |
| source.java variable.other.object, source.java variable.other.definition.java | #ebdbb2 | — |
| meta.function-parameters.lisp | #fabd2f | — |
| markup.underline | — | underline |
| string.other.link.title.markdown | #928374 | underline |
| markup.underline.link | #d3869b | — |
| markup.bold | #fe8019 | bold |
| markup.heading | #fe8019 | bold |
| markup.italic | — | italic |
| markup.inserted | #b8bb26 | — |
| markup.deleted | #d65d0e | — |
| markup.changed | #fe8019 | — |
| markup.punctuation.quote.beginning | #98971a | — |
| markup.punctuation.list.beginning | #83a598 | — |
| markup.inline.raw, markup.fenced_code.block | #8ec07c | — |
| string.quoted.double.json | #83a598 | — |
| source.json meta.structure.dictionary.json support.type.property-name.json | #b8bb26 | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #8ec07c | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #d3869b | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #b8bb26 | — |
| entity.other.attribute-name.css | #fe8019 | — |
| source.css meta.selector | #ebdbb2 | — |
| support.type.property-name.css | #fe8019 | — |
| entity.other.attribute-name.class | #b8bb26 | — |
| source.css support.function.transform, source.css support.function.timing-function, source.css support.function.misc | #fb4934 | — |
| support.property-value, constant.rgb-value, support.property-value.scss, constant.rgb-value.scss | #d65d0e | — |
| entity.name.tag.css | — | normal |
| punctuation.definition.tag | #8ec07c | — |
| text.html entity.name.tag, text.html punctuation.tag | #83a598 | bold |
| source.js variable.language | #fe8019 | — |
| source.ts variable.language | #fe8019 | — |
| source.go storage.type | #fabd2f | — |
| source.go entity.name.import | #b8bb26 | — |
| source.go keyword.package, source.go keyword.import | #8ec07c | — |
| source.go keyword.interface, source.go keyword.struct | #83a598 | — |
| source.go entity.name.type | #ebdbb2 | — |
| source.go entity.name.function | #d3869b | — |
| keyword.control.cucumber.table | #83a598 | — |
| source.reason string.double, source.reason string.regexp | #b8bb26 | — |
| source.reason keyword.control.less | #8ec07c | — |
| source.reason entity.name.function | #83a598 | — |
| source.reason support.property-value, source.reason entity.name.filename | #fe8019 | — |
| source.powershell variable.other.member.powershell | #fe8019 | — |
| source.powershell support.function.powershell | #fabd2f | — |
| source.powershell support.function.attribute.powershell | #bdae93 | — |
| source.powershell meta.hashtable.assignment.powershell variable.other.readwrite.powershell | #fe8019 | — |
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| comment, punctuation.definition.comment | #899397 | italic |
| variable, string constant.other.placeholder | #d5d2d2 | — |
| constant.other.color | #FFCB6B | — |
| invalid, invalid.illegal | #FF5370 | italic strikethrough |
| keyword, storage.type, storage.modifier | #c180f7 | — |
| entity.name.tag, meta.tag.sgml, markup.deleted.git_gutter | #7deabb | — |
| entity.name.function, meta.function-call, variable.function, support.function, keyword.other.special-method | #ffd262 | — |
| meta.block variable.other | #6cdae7 | — |
| support.other.variable, string.other.link | #f6c8cb | — |
| constant.numeric, constant.language, support.constant, constant.character, constant.escape, variable.parameter, keyword.other.unit, keyword.other | #fd8585 | — |
| string, constant.other.symbol, constant.other.key, entity.other.inherited-class, markup.heading, markup.inserted.git_gutter, meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js | #acff95 | — |
| support.type, support.class, support.other.namespace.use.php, meta.use.php, support.other.namespace.php, markup.changed.git_gutter, support.type.sys-types | #fe926d | — |
| entity.name | #FFCB6B | — |
| support.type | #B2CCD6 | — |
| source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name | #B2CCD6 | — |
| entity.name.module.js, variable.import.parameter.js, variable.other.class.js | #FF5370 | — |
| variable.language | #FF5370 | italic |
| entity.name.method.js | #82AAFF | italic |
| meta.class-method.js entity.name.function.js, variable.function.constructor | #82AAFF | — |
| entity.other.attribute-name | #ffd058 | — |
| text.html.basic entity.other.attribute-name.html, text.html.basic entity.other.attribute-name | #FFCB6B | italic |
| entity.other.attribute-name.class | #91d773 | — |
| source.sass keyword.control | #4a79dd | — |
| markup.inserted | #C3E88D | — |
| markup.deleted | #FF5370 | — |
| markup.changed | #ba74e9 | — |
| string.regexp | #acff95 | — |
| constant.character.escape | #89DDFF | — |
| *url*, *link*, *uri* | — | underline |
| tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js | #82AAFF | italic |
| source.js constant.other.object.key.js string.unquoted.label.js | #FF5370 | italic |
| source.json meta.structure.dictionary.json support.type.property-name.json | #fe926d | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json | #FFCB6B | — |
| text.html.markdown, meta.paragraph.markdown | #d2d4d5 | — |
| punctuation.definition.raw.markdown, markup.inline.raw.markdown, markup.inline.raw.string.markdown | #acff95 | — |
| text.html.markdown markup.inline.raw.markdown | #C792EA | — |
| text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown | #65737E | — |
| markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown | #fe926d | — |
| markup.italic | #7deabb | italic |
| markup.bold, markup.bold string | #7deabb | — |
| markup.bold markup.italic, markup.italic markup.bold, markup.quote markup.bold, markup.bold markup.italic string, markup.italic markup.bold string, markup.quote markup.bold string | #7deabb | — |
| markup.underline | #acff95 | underline |
| markup.quote punctuation.definition.blockquote.markdown | #65737E | — |
| markup.quote | — | italic |
| string.other.link.title.markdown | #6cdae7 | — |
| string.other.link.description.title.markdown | #c180f7 | — |
| constant.other.reference.link.markdown | #FFCB6B | — |
| markup.raw.block | #C792EA | — |
| markup.raw.block.fenced.markdown | #00000050 | — |
| punctuation.definition.fenced.markdown | #00000050 | — |
| markup.raw.block.fenced.markdown, variable.language.fenced.markdown, punctuation.section.class.end | #EEFFFF | — |
| variable.language.fenced.markdown | #65737E | — |
| meta.separator | #65737E | bold |
| markup.table | #EEFFFF | — |
| punctuation.definition.list.begin.markdown, punctuation.definition.link.title.begin.markdown, punctuation.definition.link.title.end.markdown | #c180f7 | — |
| variable.css | #7deabb | — |
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| comment, comment keyword, comment markup.underline.link, comment string, comment punctuation.definition, comment punctuation, comment text | #5c5757 | italic |
| comment storage.type | #5c5757 | — |
| comment entity.name.type | #5c5757 | — |
| comment variable, comment variable.other | #5c5757 | — |
| comment.git-status.header.remote | #fc618d | — |
| comment.git-status.header.local | #5cb3c0 | — |
| comment.other.git-status.head | #d7d7d7 | — |
| constant | #c8e1ff | — |
| constant.other | #c8e1ff | — |
| constant.other.symbol | #5cb3c0 | — |
| constant.numeric | #c8e1ff | — |
| entity.name | #fff5f5 | — |
| entity.name.function, entity.name.function-call | #b392f0 | — |
| entity.name.section | #7bcc38 | — |
| entity.name.tag, entity.name.tag.js.jsx support.class.component.js.jsx, entity.name.tag support.class.component | #b392f0 | — |
| entity.other.attribute-name | #5cb3c0 | italic |
| entity.other.attribute-name.class.css, entity.other.attribute-name.parent-selector-suffix.css, entity.other.attribute-name.parent-selector-suffix.css punctuation.definition.entity.css, entity.other.attribute-name.css | #b392f0 | italic |
| entity.other.attribute-name.id.css | #5ae6b7 | italic |
| entity.other.attribute-name.pseudo-class.css, entity.other.pseudo-class.css, entity.other.pseudo-element.css | #5cb3c0 | italic |
| entity.other.git-status.hex | #948ae3 | — |
| invalid | — | italic |
| keyword | #7bcc38 | — |
| keyword.operator, keyword.operator.member, keyword.operator.new | #7bcc38 | — |
| keyword.other.substitution | #8b888f | — |
| markup.italic | — | italic |
| markup.bold | — | bold |
| markup.heading | #7bcc38 | — |
| markup.raw | #fd9353 | — |
| markup.underline | — | underline |
| markup.underline.link | #5cb3c0 | — |
| markup.inserted, markup.inserted punctuation.definition.inserted | #7bd88f | — |
| markup.deleted, markup.deleted punctuation.definition.deleted | #fc618d | — |
| markup.changed, markup.changed punctuation.definition.changed | #fce566 | — |
| markup.ignored, markup.ignored punctuation.definition.ignored | #8b888f | — |
| markup.untracked | #8b888f | — |
| markup.quote | — | italic |
| meta.brace.round, meta.brace.square, meta.brace.curly, meta.delimiter.comma.js, meta.function-call.without-arguments.js, meta.function-call.method.without-arguments.js | #888f88 | — |
| meta.function-call.python, meta.function-call.arguments.python meta.function-call.python | #b392f0 | — |
| meta.function-call.python meta.function-call.arguments.python | #fff5f5 | — |
| meta.object.member | #fff5f5 | — |
| meta.diff.git-diff.header | #fce566 | — |
| meta.separator.markdown | #8b888f | — |
| punctuation | #8b888f | — |
| punctuation.definition.variable, punctuation.definition.keyword.scss, punctuation.definition.entity.css | #bab6c0 | — |
| source | #d7d7d7 | — |
| source.scss, source.sass | #8f8888 | — |
| source.sass variable.other, source.sass variable.sass, source.scss variable.other, source.scss variable.scss, source.scss variable.sass, source.css variable.other, source.css variable.scss, source.less variable.other, source.less variable.other.less, source.less variable.declaration.less | #fff5f5 | italic |
| source.git-show.commit.sha | #948ae3 | — |
| source.git-show.author, source.git-show.date, source.git-diff.command, source.git-diff.command meta.diff.git-diff.header.from-file, source.git-diff.command meta.diff.git-diff.header.to-file | #8b888f | — |
| source.git-show meta.diff.git-diff.header.extended.index.from-sha, source.git-show meta.diff.git-diff.header.extended.index.to-sha | #948ae3 | — |
| source.git-show meta.diff.range.unified | #fd9353 | — |
| source.git-show meta.diff.header.from-file, source.git-show meta.diff.header.to-file | #8f8888 | — |
| storage | #5cb3c0 | — |
| storage.modifier, storage.type.modifier | #7bcc38 | italic |
| storage.type | #5cb3c0 | italic |
| storage.type.function.arrow | #7bcc38 | |
| string | #e69850 | — |
| string source | #fff5f5 | — |
| string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end | #7bcc38 | — |
| support.constant | #5cb3c0 | — |
| support.function | #5ae6b7 | — |
| support.type, entity.name.type.object.console | #5cb3c0 | italic |
| support.type.property-name | #c8e1ff | |
| support.variable | #5cb3c0 | — |
| support.class | #5cb3c0 | — |
| text | #fff5f5 | — |
| variable | #fff5f5 | — |
| variable.parameter, parameters variable.function | #bab6c0 | italic |
| variable.language, variable.parameter.function.language.special.self.python, variable.parameter.function.language.special.cls.python | #bab6c0 | italic |
| variable.other.object | #bab6c0 | — |
| variable.other.constant, variable.other.property, variable.other.object.property | #c8e1ff | — |
| token.info-token | #316BCD | — |
| token.warn-token | #cd9731 | — |
| token.error-token | #f44747 | — |
| token.debug-token | #b267e6 | — |
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| — | #BDB76B | — |
| comment | #57a64a | |
| variable | #BDB76B | |
| keyword | #D8A0DF | |
| keyword.operator.comparison | #DCDCDC | |
| keyword.operator.assignment | #DCDCDC | |
| keyword.operator.arithmetic | #DCDCDC | |
| constant.numeric | #B5CEA8 | |
| constant | #B4CEA8 | |
| constant.language | #569CD6 | |
| constant.language.boolean | #569CD6 | |
| string | #d69d85 | |
| constant.character.escape, string source | #D69D85 | |
| meta.preprocessor | #bd63c5 | |
| keyword.control.import | #bd63c5 | |
| entity.name.function, keyword.other.name-of-parameter.objc | #ff8000 | |
| entity.name.type | #FFD700 | |
| storage.type | #ffd700 | |
| storage.modifier | #569CD6 | |
| entity.other.inherited-class | #FFD700 | |
| variable.parameter | #BDB76B | |
| storage.type.method | #BDB76B | |
| meta.section entity.name.section, declaration.section entity.name.section | #8A8A8A | — |
| support.function | #ff8000 | |
| support.class, support.type | #ffd700 | |
| support.constant | #ffd700 | |
| support.variable | #BDB76B | |
| keyword.operator.js | #687687 | — |
| invalid | #ff3333 | — |
| invalid.deprecated.trailing-whitespace | — | — |
| text source, string.unquoted | — | — |
| meta.xml-processing, declaration.xml-processing | #68685B | |
| meta.doctype, declaration.doctype | #808080 | |
| meta.doctype.DTD, declaration.doctype.DTD | — | |
| meta.tag, declaration.tag | #808080 | |
| entity.name.tag | #569CD6 | |
| entity.other.attribute-name | #92CAF4 | |
| string.quoted.double.xml, string.quoted.double.html | #C8C8C8 | |
| markup.heading | #569CD6 | |
| markup.quote | #DCDCDC | |
| markup.list | #DCDCDC | — |
| meta.selector.css entity.name.tag | #D7BA7D | — |
| meta.selector.css entity.other.attribute-name.tag.pseudo-class | #D7BA7D | — |
| meta.selector.css entity.other.attribute-name.id | #D7BA7D | — |
| meta.selector.css entity.other.attribute-name.class | #D7BA7D | — |
| support.type.property-name.css | #9CDCFE | — |
| meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css | #C8C8C8 | — |
| meta.preprocessor.at-rule keyword.control.at-rule | #87CEFA | — |
| source.cs comment.block.documentation.source.cs meta.tag.xml, source.cs comment.block.documentation.source.cs meta.tag.xml entity.name.tag.localname.xml, source.cs comment.block.documentation.source.cs meta.tag.xml entity.other.attribute-name | #608B4E | — |
| markup.deleted.git_gutter | #F92672 | — |
| markup.inserted.git_gutter | #A6E22E | — |
| markup.changed.git_gutter | #967EFB | — |
| markup.ignored.git_gutter | #565656 | — |
| markup.untracked.git_gutter | #565656 | — |
| git.changes.x | — | — |
| git.changes.+ | — | — |
| git.changes.- | — | — |
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}