mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-16 14:06:49 +01:00
10 lines
315 B
TypeScript
10 lines
315 B
TypeScript
import type { HttpResponseHeader } from '@yaakapp/api';
|
|
import { useMemo } from 'react';
|
|
|
|
export function useContentTypeFromHeaders(headers: HttpResponseHeader[] | null): string | null {
|
|
return useMemo(
|
|
() => headers?.find((h) => h.name.toLowerCase() === 'content-type')?.value ?? null,
|
|
[headers],
|
|
);
|
|
}
|