render detail component and get data from database