fix(attachment): replace never exhaustive check to fix Colab TS2322 build error

`attachment.type` resolves to `string & {}` via @assistant-ui/store@0.1.6's
generic type chain when installed through npm (package-lock.json), breaking
the `const _exhaustiveCheck: never = type` exhaustive check pattern.

Replace with a direct throw that compiles cleanly across library versions
while preserving identical runtime behaviour.

Fixes #263

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Leo Borcherding 2026-02-25 17:27:10 -06:00
commit babc88fbee

View file

@ -149,10 +149,8 @@ const AttachmentUI: FC = () => {
return "Document";
case "file":
return "File";
default: {
const _exhaustiveCheck: never = type;
throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
}
default:
throw new Error(`Unknown attachment type: ${type as string}`);
}
});