project-standalo-sonic-cloud/.workflow/versions/v004/contexts/component_share_content_dis...

93 lines
2.6 KiB
YAML

task_id: task_create_component_share_content_display
entity_id: component_share_content_display
generated_at: '2025-12-18T18:15:12.919309'
workflow_version: v004
target:
type: component
definition:
id: component_share_content_display
name: SharedContentDisplay
description: Displays shared song/playlist/album with call-to-action
file_path: components/SharedContentDisplay.tsx
props:
- name: type
type: '''song'' | ''playlist'' | ''album'''
required: true
description: Type of shared content
- name: content
type: object
required: true
description: Content data (song/playlist/album with artist info)
state:
- name: isPlaying
type: boolean
description: Audio playback state (for songs)
uses_components: []
uses_apis:
- api_track_share_click
business_logic:
- Display cover art, title, artist name
- For songs: show waveform, duration, play button
- For playlists: show track count, curator
- For albums: show release date, track count
- 'Call-to-action button: "Listen on Sonic Cloud" or "Sign up to create playlists"'
styling:
- Large cover art
- Prominent title and artist
- Clean, minimal design focused on content
- Branded CTA button
- Preview player for songs (if implemented)
related:
models: []
apis:
- id: api_track_share_click
definition: &id001
id: api_track_share_click
method: POST
path: /api/share/[token]/click
description: Increment share click count for analytics
auth:
required: false
request_params:
- name: token
type: string
location: path
required: true
description: Share token to track click for
request_body: []
responses:
- status: 200
description: Click tracked successfully
schema:
success: boolean
clickCount: integer
- status: 404
description: Share not found
schema:
error: string
business_logic:
- Find Share record by token
- Increment clickCount by 1
- Return new click count
depends_on_models:
- model_share
components: []
dependencies:
entity_ids:
- api_track_share_click
definitions:
- id: api_track_share_click
type: api
definition: *id001
files:
to_create:
- app/components/SharedContentDisplay.tsx
reference: []
acceptance:
- criterion: Component renders without errors
verification: Import and render in test
- criterion: Props are typed correctly
verification: TypeScript compilation
- criterion: Events fire correctly
verification: Test event handlers