MintShot Themes
A collection of dark and light themes for VS Code and compatible editors with refined neutral surfaces and expressive accents.
A collection of dark and light themes for VS Code and compatible editors with refined neutral surfaces and expressive accents.
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.block.documentation, comment.line.documentation, comment.block, comment.line, punctuation.definition.comment | #3E4A4580 | italic |
| keyword.control, keyword.control.flow, keyword.control.conditional, keyword.control.loop, keyword.control.return, keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.trycatch, keyword.control.exception | #C084FC | bold |
| storage, storage.type, storage.modifier, storage.type.function, storage.type.class, storage.type.interface, storage.type.enum, storage.type.struct, storage.type.type, keyword.type, keyword.control.new, keyword.control.as, keyword.control.default, keyword.other, keyword.other.rust, keyword.other.fn.rust, keyword.other.crate.rust, keyword.other.use.rust, keyword.other.where.rust | #C084FC | bold |
| keyword | #C084FC | bold |
| keyword.operator, keyword.operator.assignment, keyword.operator.arithmetic, keyword.operator.comparison, keyword.operator.logical, keyword.operator.ternary, keyword.operator.spread, keyword.operator.rest, keyword.operator.type, keyword.operator.expression, punctuation.separator, punctuation.terminator, punctuation.accessor | #7A8A84 | — |
| string, string.template, string.quoted, string.quoted.single, string.quoted.double, string.quoted.triple, string.interpolated, punctuation.definition.string | #FDBA74 | — |
| string.regexp, constant.regexp, regexp, support.other.regexp | #D8B4FE | italic |
| constant.numeric | #F472B6 | — |
| constant.language.boolean, constant.language.null, constant.language.undefined, constant.language, support.constant.builtin | #F472B6 | bold |
| variable, variable.other.readwrite, entity.name.variable, variable.other, variable.language.this, variable.language.self, variable.language.super | #D4D4D4 | — |
| variable.parameter, meta.parameter | #E9D5FF | italic |
| variable.other.property, variable.object.property, meta.property-name, support.variable.property, entity.name.record.field | #C4B5FD | — |
| variable.other.constant, variable.other.enummember, constant.other, support.constant, entity.name.constant | #93C5FD | bold |
| entity.name.type, entity.name.type.class, entity.name.struct, entity.name.type.alias, entity.name.union, support.class, support.type, entity.other.inherited-class | #3ECFA0 | bold |
| entity.name.type.interface | #E9D5FF | italic |
| entity.name.type.enum | #67E8F9 | bold |
| entity.name.type.parameter | #E9D5FF | italic |
| support.type.primitive, support.type.builtin, storage.type.primitive, storage.type.built-in, keyword.type.boolean, keyword.type.number, keyword.type.string | #DDD6FE | — |
| entity.name.namespace, entity.name.module, support.module | #7A8A84 | italic |
| entity.name.function, entity.name.function.member, meta.function-call, support.function, variable.function | #FCD34D | bold |
| entity.name.function.macro, support.function.macro | #FB7185 | bold |
| entity.name.function.decorator, meta.decorator, entity.name.tag.annotation, punctuation.decorator | #FB7185 | italic |
| punctuation.definition.lifetime, entity.name.type.lifetime, storage.modifier.lifetime | #E9D5FF | italic |
| meta.attribute.rust, punctuation.definition.attribute.rust, punctuation.brackets.attribute.rust | #FB7185 | italic |
| entity.name.tag, punctuation.definition.tag, punctuation.definition.tag.begin, punctuation.definition.tag.end | #C084FC | bold |
| support.class.component | #8B5CF6 | bold |
| entity.other.attribute-name, entity.other.attribute-name.class, entity.other.attribute-name.id | #A78BFA | italic |
| entity.name.label | #A78BFA | — |
| constant.character.escape | #FCD34D | bold |
| punctuation.definition.template-expression, punctuation.section.embedded, meta.template.expression | #C084FC | bold |
| markup.heading, markup.heading punctuation.definition.heading | #C084FC | bold |
| markup.bold | #E8E8E8 | bold |
| markup.italic | #E8E8E8 | italic |
| markup.inline.raw, markup.underline.link, string.other.link.title, string.other.link | #8B5CF6 | — |
| markup.list, punctuation.definition.list | #7A8A84 | — |
| markup.quote | #546E64 | italic |
| invalid, invalid.deprecated | #FF6B6B | bold |
| support.type.property-name.css, support.type.property-name.scss, meta.property-name.css | #A78BFA | italic |
| support.constant.property-value.css, keyword.other.unit.css, constant.numeric.css | #C4B5FD | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css | #C084FC | bold |
| keyword.key.toml, support.type.property-name.toml, entity.name.tag.toml | #A78BFA | italic |
| entity.other.attribute-name.table.toml, entity.other.attribute-name.table.array.toml | #8B5CF6 | bold |
| support.type.property-name.json | #A78BFA | italic |
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.block.documentation, comment.line.documentation, comment.block, comment.line, punctuation.definition.comment | #3E4A4580 | italic |
| keyword.control, keyword.control.flow, keyword.control.conditional, keyword.control.loop, keyword.control.return, keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.trycatch, keyword.control.exception | #F87171 | bold |
| storage, storage.type, storage.modifier, storage.type.function, storage.type.class, storage.type.interface, storage.type.enum, storage.type.struct, storage.type.type, keyword.type, keyword.control.new, keyword.control.as, keyword.control.default, keyword.other, keyword.other.rust, keyword.other.fn.rust, keyword.other.crate.rust, keyword.other.use.rust, keyword.other.where.rust | #F87171 | bold |
| keyword | #F87171 | bold |
| keyword.operator, keyword.operator.assignment, keyword.operator.arithmetic, keyword.operator.comparison, keyword.operator.logical, keyword.operator.ternary, keyword.operator.spread, keyword.operator.rest, keyword.operator.type, keyword.operator.expression, punctuation.separator, punctuation.terminator, punctuation.accessor | #7A8A84 | — |
| string, string.template, string.quoted, string.quoted.single, string.quoted.double, string.quoted.triple, string.interpolated, punctuation.definition.string | #7DD3FC | — |
| string.regexp, constant.regexp, regexp, support.other.regexp | #FDA4AF | italic |
| constant.numeric | #C084FC | — |
| constant.language.boolean, constant.language.null, constant.language.undefined, constant.language, support.constant.builtin | #C084FC | bold |
| variable, variable.other.readwrite, entity.name.variable, variable.other, variable.language.this, variable.language.self, variable.language.super | #D4D4D4 | — |
| variable.parameter, meta.parameter | #FECACA | italic |
| variable.other.property, variable.object.property, meta.property-name, support.variable.property, entity.name.record.field | #FCA5A5 | — |
| variable.other.constant, variable.other.enummember, constant.other, support.constant, entity.name.constant | #F87171 | bold |
| entity.name.type, entity.name.type.alias, entity.name.union, support.type | #EF4444 | bold |
| entity.name.type.class, support.class, entity.other.inherited-class | #DC2626 | bold |
| entity.name.type.interface | #FECACA | italic |
| entity.name.type.enum | #FB7185 | bold |
| entity.name.struct | #E53E3E | bold |
| entity.name.type.parameter | #FECACA | italic |
| support.type.primitive, support.type.builtin, storage.type.primitive, storage.type.built-in, keyword.type.boolean, keyword.type.number, keyword.type.string | #FECACA | — |
| entity.name.namespace, entity.name.module, support.module | #7A8A84 | italic |
| entity.name.function, entity.name.function.member, meta.function-call, support.function, variable.function | #FCD34D | bold |
| entity.name.function.macro, support.function.macro | #FBBF24 | bold |
| entity.name.function.decorator, meta.decorator, entity.name.tag.annotation, punctuation.decorator | #FBBF24 | italic |
| punctuation.definition.lifetime, entity.name.type.lifetime, storage.modifier.lifetime | #FECACA | italic |
| meta.attribute.rust, punctuation.definition.attribute.rust, punctuation.brackets.attribute.rust | #FBBF24 | italic |
| entity.name.tag, punctuation.definition.tag, punctuation.definition.tag.begin, punctuation.definition.tag.end | #F87171 | bold |
| support.class.component | #DC2626 | bold |
| entity.other.attribute-name, entity.other.attribute-name.class, entity.other.attribute-name.id | #EF4444 | italic |
| entity.name.label | #EF4444 | — |
| constant.character.escape | #FCD34D | bold |
| punctuation.definition.template-expression, punctuation.section.embedded, meta.template.expression | #F87171 | bold |
| markup.heading, markup.heading punctuation.definition.heading | #F87171 | bold |
| markup.bold | #E8E8E8 | bold |
| markup.italic | #E8E8E8 | italic |
| markup.inline.raw, markup.underline.link, string.other.link.title, string.other.link | #EF4444 | — |
| markup.list, punctuation.definition.list | #7A8A84 | — |
| markup.quote | #546E64 | italic |
| invalid, invalid.deprecated | #F87171 | bold |
| support.type.property-name.css, support.type.property-name.scss, meta.property-name.css | #EF4444 | italic |
| support.constant.property-value.css, keyword.other.unit.css, constant.numeric.css | #FCA5A5 | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css | #F87171 | bold |
| keyword.key.toml, support.type.property-name.toml, entity.name.tag.toml | #EF4444 | italic |
| entity.other.attribute-name.table.toml, entity.other.attribute-name.table.array.toml | #DC2626 | bold |
| support.type.property-name.json | #EF4444 | italic |
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 |
|---|---|---|
| meta.embedded, source.groovy.embedded | #D7D7D7 | — |
| emphasis | — | italic |
| strong | — | bold |
| header | #14148A | — |
| comment | #55615C99 | italic |
| constant.language | #64A4D9 | — |
| constant.numeric, entity.name.operator.custom-literal.number, variable.other.enummember, keyword.operator.plus.exponent, keyword.operator.minus.exponent | #BBD2AF | — |
| constant.regexp | #70729D | — |
| entity.name.tag | #64A4D9 | — |
| entity.name.tag.css | #DAC087 | — |
| entity.other.attribute-name | #A4DFFE | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.class.mixin.css, entity.other.attribute-name.id.css, entity.other.attribute-name.parent-selector.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css, source.css.less entity.other.attribute-name.id, entity.other.attribute-name.attribute.scss, entity.other.attribute-name.scss | #DAC087 | — |
| invalid | #F55656 | — |
| markup.underline | — | underline |
| markup.bold | #64A4D9 | bold |
| markup.heading | #64A4D9 | bold |
| markup.italic | — | italic |
| markup.inserted | #BBD2AF | — |
| markup.deleted | #D29A83 | — |
| markup.changed | #64A4D9 | — |
| punctuation.definition.quote.begin.markdown | #76A163 | — |
| punctuation.definition.list.begin.markdown | #739EE8 | — |
| markup.inline.raw | #D29A83 | — |
| punctuation.definition.tag | #8A8A8A | — |
| meta.preprocessor | #64A4D9 | — |
| meta.preprocessor.string | #D29A83 | — |
| meta.preprocessor.numeric | #BBD2AF | — |
| meta.structure.dictionary.key.python | #A4DFFE | — |
| meta.diff.header | #64A4D9 | — |
| storage | #64A4D9 | — |
| storage.type | #64A4D9 | — |
| storage.modifier, keyword.operator.noexcept | #64A4D9 | — |
| string, entity.name.operator.custom-literal.string, meta.embedded.assembly | #D29A83 | — |
| string.tag | #D29A83 | — |
| string.value | #D29A83 | — |
| string.regexp | #D57575 | — |
| punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end, punctuation.section.embedded | #64A4D9 | — |
| meta.template.expression | #D7D7D7 | — |
| support.type.vendored.property-name, support.type.property-name, variable.css, variable.scss, variable.other.less, source.coffee.embedded | #BEE9FF | — |
| keyword.control, keyword.operator | #CA90C5 | — |
| keyword.operator.new, keyword.operator.expression, keyword.operator.cast, keyword.operator.sizeof, keyword.operator.alignof, keyword.operator.typeid, keyword.operator.alignas, keyword.operator.instanceof, keyword.operator.logical.python, keyword.operator.wordlike | #64A4D9 | — |
| keyword.other.unit | #BBD2AF | — |
| punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php | #64A4D9 | — |
| support.function.git-rebase | #A4DFFE | — |
| constant.sha.git-rebase | #BBD2AF | — |
| storage.modifier.import.java, variable.language.wildcard.java, storage.modifier.package.java | #D7D7D7 | — |
| variable.language | #64A4D9 | — |
| variable.language.rust, variable.language.self.rust, variable.language.self.rust.mutable | #64A4D9 | italic |
| entity.name.function.preprocessor, entity.name.function, support.function, support.constant.handlebars, source.powershell variable.other.member, entity.name.operator.custom-literal | #DFDFB1 | — |
| meta.return-type, support.class, support.type, entity.name.type, entity.name.namespace, entity.other.attribute, entity.name.scope-resolution, entity.name.class, storage.type.numeric.go, storage.type.byte.go, storage.type.boolean.go, storage.type.string.go, storage.type.uintptr.go, storage.type.error.go, storage.type.rune.go, storage.type.cs, storage.type.generic.cs, storage.type.modifier.cs, storage.type.variable.cs, storage.type.groovy, storage.type.annotation.groovy, storage.type.parameters.groovy, storage.type.generic.groovy, storage.type.object.array.groovy, storage.type.primitive.array.groovy, storage.type.primitive.groovy, variable.other.enummember, entity.name.type.option.rust, entity.name.type.result.rust | #5CCDB6 | — |
| meta.attribute.rust entity.name.type, meta.attribute.rust entity.name.class, meta.attribute.rust support.class, meta.attribute.rust support.type | #D29A83 | — |
| meta.type.cast.expr, meta.type.new.expr, support.constant.math, support.constant.dom, support.constant.json, entity.other.inherited-class | #5CCDB6 | — |
| keyword.control, keyword.operator.dereference.rust, source.cpp keyword.operator.new, keyword.operator.delete, keyword.other.using, keyword.other.operator, entity.name.operator | #CA90C5 | — |
| variable, meta.definition.variable.name, support.variable, entity.name.variable | #E8EAF1 | — |
| meta.object-literal.key | #D6F3FF | — |
| support.constant.property-value, support.constant.font-name, support.constant.media-type, support.constant.media, constant.other.color.rgb-value, constant.other.rgb-value, support.constant.color | #D29A83 | — |
| punctuation.definition.group.regexp, punctuation.definition.group.assertion.regexp, punctuation.definition.character-class.regexp, punctuation.character.set.begin.regexp, punctuation.character.set.end.regexp, keyword.operator.negation.regexp, support.other.parenthesis.regexp | #D29A83 | — |
| constant.character.character-class.regexp, constant.other.character-class.set.regexp, constant.other.character-class.regexp, constant.character.set.regexp | #D57575 | — |
| keyword.operator.or.regexp, keyword.control.anchor.regexp | #DFDFB1 | — |
| keyword.operator.quantifier.regexp | #DAC087 | — |
| constant.character | #64A4D9 | — |
| constant.character.escape | #DAC087 | — |
| entity.name.label | #CCCCCC | — |
| keyword, storage.type.java | #64A4D9 | — |
| support.other.excluded | #8A8A8A | — |
| keyword.preprocessor | #8A8A8A | — |
| punctuation.semi | #5E5E5E | — |
| punctuation.definition.comment | #55615C99 | italic |
| punctuation.definition.string | #D29A83 | — |
| entity.name.namespace | #D7D7D7 | — |
| entity.name.variable.field | #D6F3FF | — |
| variable.other.property | #D6F3FF | — |
| variable.other.constant | #E8EAF1 | — |
| entity.name.type.interface | #BEDAAA | — |
| entity.name.type.enum | #CA90C5 | — |
| entity.name.type.parameter | #BEDAAA | — |
| entity.name.type.struct | #90CB9A | — |
| entity.name.function.extension | #DFDFB1 | — |
| comment.documentation | #55615C99 | italic |
| comment.documentation.attribute | #55615C99 | italic |
| comment.documentation.cdata | #55615C99 | italic |
| comment.documentation.delimiter | #55615C99 | italic |
| comment.documentation.name | #55615C99 | italic |
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 |
|---|---|---|
| meta.embedded, source.groovy.embedded | #D7D7D7 | — |
| emphasis | — | italic |
| strong | — | bold |
| header | #14148A | — |
| comment | #55615C99 | italic |
| constant.language | #64A4D9 | — |
| constant.numeric, entity.name.operator.custom-literal.number, variable.other.enummember, keyword.operator.plus.exponent, keyword.operator.minus.exponent | #BBD2AF | — |
| constant.regexp | #70729D | — |
| entity.name.tag | #64A4D9 | — |
| entity.name.tag.css | #DAC087 | — |
| entity.other.attribute-name | #A4DFFE | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.class.mixin.css, entity.other.attribute-name.id.css, entity.other.attribute-name.parent-selector.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css, source.css.less entity.other.attribute-name.id, entity.other.attribute-name.attribute.scss, entity.other.attribute-name.scss | #DAC087 | — |
| invalid | #F55656 | — |
| markup.underline | — | underline |
| markup.bold | #64A4D9 | bold |
| markup.heading | #64A4D9 | bold |
| markup.italic | — | italic |
| markup.inserted | #BBD2AF | — |
| markup.deleted | #D29A83 | — |
| markup.changed | #64A4D9 | — |
| punctuation.definition.quote.begin.markdown | #76A163 | — |
| punctuation.definition.list.begin.markdown | #739EE8 | — |
| markup.inline.raw | #D29A83 | — |
| punctuation.definition.tag | #8A8A8A | — |
| meta.preprocessor | #64A4D9 | — |
| meta.preprocessor.string | #D29A83 | — |
| meta.preprocessor.numeric | #BBD2AF | — |
| meta.structure.dictionary.key.python | #A4DFFE | — |
| meta.diff.header | #64A4D9 | — |
| storage | #64A4D9 | — |
| storage.type | #64A4D9 | — |
| storage.modifier, keyword.operator.noexcept | #64A4D9 | — |
| string, entity.name.operator.custom-literal.string, meta.embedded.assembly | #D29A83 | — |
| string.tag | #D29A83 | — |
| string.value | #D29A83 | — |
| string.regexp | #D57575 | — |
| punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end, punctuation.section.embedded | #64A4D9 | — |
| meta.template.expression | #D7D7D7 | — |
| support.type.vendored.property-name, support.type.property-name, variable.css, variable.scss, variable.other.less, source.coffee.embedded | #BEE9FF | — |
| keyword.control, keyword.operator | #CA90C5 | — |
| keyword.operator.new, keyword.operator.expression, keyword.operator.cast, keyword.operator.sizeof, keyword.operator.alignof, keyword.operator.typeid, keyword.operator.alignas, keyword.operator.instanceof, keyword.operator.logical.python, keyword.operator.wordlike | #64A4D9 | — |
| keyword.other.unit | #BBD2AF | — |
| punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php | #64A4D9 | — |
| support.function.git-rebase | #A4DFFE | — |
| constant.sha.git-rebase | #BBD2AF | — |
| storage.modifier.import.java, variable.language.wildcard.java, storage.modifier.package.java | #D7D7D7 | — |
| variable.language | #64A4D9 | — |
| variable.language.rust, variable.language.self.rust, variable.language.self.rust.mutable | #64A4D9 | italic |
| entity.name.function.preprocessor, entity.name.function, support.function, support.constant.handlebars, source.powershell variable.other.member, entity.name.operator.custom-literal | #DFDFB1 | — |
| meta.return-type, support.class, support.type, entity.name.type, entity.name.namespace, entity.other.attribute, entity.name.scope-resolution, entity.name.class, storage.type.numeric.go, storage.type.byte.go, storage.type.boolean.go, storage.type.string.go, storage.type.uintptr.go, storage.type.error.go, storage.type.rune.go, storage.type.cs, storage.type.generic.cs, storage.type.modifier.cs, storage.type.variable.cs, storage.type.groovy, storage.type.annotation.groovy, storage.type.parameters.groovy, storage.type.generic.groovy, storage.type.object.array.groovy, storage.type.primitive.array.groovy, storage.type.primitive.groovy, variable.other.enummember, entity.name.type.option.rust, entity.name.type.result.rust | #5CCDB6 | — |
| meta.attribute.rust entity.name.type, meta.attribute.rust entity.name.class, meta.attribute.rust support.class, meta.attribute.rust support.type | #D29A83 | — |
| meta.type.cast.expr, meta.type.new.expr, support.constant.math, support.constant.dom, support.constant.json, entity.other.inherited-class | #5CCDB6 | — |
| keyword.control, keyword.operator.dereference.rust, source.cpp keyword.operator.new, keyword.operator.delete, keyword.other.using, keyword.other.operator, entity.name.operator | #CA90C5 | — |
| variable, meta.definition.variable.name, support.variable, entity.name.variable | #E8EAF1 | — |
| meta.object-literal.key | #D6F3FF | — |
| support.constant.property-value, support.constant.font-name, support.constant.media-type, support.constant.media, constant.other.color.rgb-value, constant.other.rgb-value, support.constant.color | #D29A83 | — |
| punctuation.definition.group.regexp, punctuation.definition.group.assertion.regexp, punctuation.definition.character-class.regexp, punctuation.character.set.begin.regexp, punctuation.character.set.end.regexp, keyword.operator.negation.regexp, support.other.parenthesis.regexp | #D29A83 | — |
| constant.character.character-class.regexp, constant.other.character-class.set.regexp, constant.other.character-class.regexp, constant.character.set.regexp | #D57575 | — |
| keyword.operator.or.regexp, keyword.control.anchor.regexp | #DFDFB1 | — |
| keyword.operator.quantifier.regexp | #DAC087 | — |
| constant.character | #64A4D9 | — |
| constant.character.escape | #DAC087 | — |
| entity.name.label | #CCCCCC | — |
| keyword, storage.type.java | #64A4D9 | — |
| support.other.excluded | #8A8A8A | — |
| keyword.preprocessor | #8A8A8A | — |
| punctuation.semi | #5E5E5E | — |
| punctuation.definition.comment | #55615C99 | italic |
| punctuation.definition.string | #D29A83 | — |
| entity.name.namespace | #D7D7D7 | — |
| entity.name.variable.field | #D6F3FF | — |
| variable.other.property | #D6F3FF | — |
| variable.other.constant | #E8EAF1 | — |
| entity.name.type.interface | #BEDAAA | — |
| entity.name.type.enum | #CA90C5 | — |
| entity.name.type.parameter | #BEDAAA | — |
| entity.name.type.struct | #90CB9A | — |
| entity.name.function.extension | #DFDFB1 | — |
| comment.documentation | #55615C99 | italic |
| comment.documentation.attribute | #55615C99 | italic |
| comment.documentation.cdata | #55615C99 | italic |
| comment.documentation.delimiter | #55615C99 | italic |
| comment.documentation.name | #55615C99 | italic |
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}!`;
}