NEXT_STEPS item 7 needed the installed-but-not-downloaded state to be clear to users. Keep streamed installs in the installed visual state so sorting, filters, and the primary Play action stay unchanged, but make the sharing limitation visible in the UI. Cards now label that state as `Not shareable`, while the detail modal status says `Installed, not shareable`. Downloaded-and-installed games keep the normal `Installed` wording. Test Plan: - just frontend-test - just build - git diff --check - git diff --cached --check Refs: NEXT_STEPS.md item 7
21 lines
587 B
TypeScript
21 lines
587 B
TypeScript
import { Game } from '../lib/types';
|
|
import { deriveState, stateChipLabel } from '../lib/gameState';
|
|
|
|
interface Props {
|
|
game: Game;
|
|
/** Render even for `none` (used in the detail modal). */
|
|
showNone?: boolean;
|
|
}
|
|
|
|
export const StateChip = ({ game, showNone = false }: Props) => {
|
|
const state = deriveState(game);
|
|
const label = stateChipLabel(game);
|
|
if (!label && !showNone) return null;
|
|
return (
|
|
<div className="state-chip" data-state={state}>
|
|
<span className="state-dot" />
|
|
{label || 'Not downloaded'}
|
|
</div>
|
|
);
|
|
};
|